]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
zns: support piremap flag for zone append
authorKlaus Jensen <k.jensen@samsung.com>
Tue, 9 Mar 2021 13:22:50 +0000 (14:22 +0100)
committerKeith Busch <kbusch@kernel.org>
Tue, 9 Mar 2021 18:07:35 +0000 (11:07 -0700)
Add the '--piremap' / '-P' flag for zone-append.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
linux/nvme.h
plugins/zns/zns.c

index 16640ed1c9de30962c1d0eb1da49b1ba346d43db..355bcb046ecc57e0e2c6570812882129d750a9bc 100644 (file)
@@ -1143,6 +1143,7 @@ enum {
        NVME_RW_DSM_LATENCY_LOW         = 3 << 4,
        NVME_RW_DSM_SEQ_REQ             = 1 << 6,
        NVME_RW_DSM_COMPRESSED          = 1 << 7,
+       NVME_RW_PIREMAP                 = 1 << 9,
        NVME_RW_PRINFO_PRCHK_REF        = 1 << 10,
        NVME_RW_PRINFO_PRCHK_APP        = 1 << 11,
        NVME_RW_PRINFO_PRCHK_GUARD      = 1 << 12,
index 46f95f77292866ee69fc411a5e5eb21ee671464b..baf880fe72bb578f5e9ca9ad3e03d2ec97d70b76 100644 (file)
@@ -670,6 +670,7 @@ static int zone_append(int argc, char **argv, struct command *cmd, struct plugin
        const char *limited_retry = "limit media access attempts";
        const char *fua = "force unit access";
        const char *prinfo = "protection information action and checks field";
+       const char *piremap = "protection information remap (for type 1 PI)";
        const char *ref_tag = "reference tag (for end to end PI)";
        const char *lbat = "logical block application tag (for end to end PI)";
        const char *lbatm = "logical block application tag mask (for end to end PI)";
@@ -699,6 +700,7 @@ static int zone_append(int argc, char **argv, struct command *cmd, struct plugin
                __u16  lbat;
                __u16  lbatm;
                __u8   prinfo;
+               int    piremap;
                int   latency;
        };
 
@@ -718,6 +720,7 @@ static int zone_append(int argc, char **argv, struct command *cmd, struct plugin
                OPT_SHRT("app-tag-mask",      'm', &cfg.lbatm,         lbatm),
                OPT_SHRT("app-tag",           'a', &cfg.lbat,          lbat),
                OPT_BYTE("prinfo",            'p', &cfg.prinfo,        prinfo),
+               OPT_FLAG("piremap",           'P', &cfg.piremap,       piremap),
                OPT_FLAG("latency",           't', &cfg.latency,       latency),
                OPT_END()
        };
@@ -823,6 +826,8 @@ static int zone_append(int argc, char **argv, struct command *cmd, struct plugin
                control |= NVME_RW_LR;
        if (cfg.fua)
                control |= NVME_RW_FUA;
+       if (cfg.piremap)
+               control |= NVME_RW_PIREMAP;
 
        gettimeofday(&start_time, NULL);
        err = nvme_zns_append(fd, cfg.namespace_id, cfg.zslba, nblocks,