]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
zns: print select_all field for Zone Management Send
authorMinwoo Im <minwoo.im.dev@gmail.com>
Thu, 14 Jan 2021 13:52:52 +0000 (22:52 +0900)
committerKeith Busch <kbusch@kernel.org>
Tue, 26 Jan 2021 21:21:18 +0000 (14:21 -0700)
If Select All field in CDW13 is set to 1, SLBA(Starting LBA) will be
ignored.  This patch added a select all field to print out when
successfully done.  More informative success log with this field.

Example:
  # nvme zns reset-zone /dev/nvme0n1 -s 0 -a
  zns-reset-zone: Success, action:4 zone:0 all:1 nsid:1

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
plugins/zns/zns.c

index 26b3f90d0ad69ddebc822412fc210d52db7b2113..a6191dd84a97e724da4f721c26ea89ad330160d1 100644 (file)
@@ -184,8 +184,9 @@ static int zns_mgmt_send(int argc, char **argv, struct command *cmd, struct plug
        err = __zns_mgmt_send(fd, cfg.namespace_id, cfg.zslba,
                cfg.select_all, zsa, 0, NULL);
        if (!err)
-               printf("%s: Success, action:%d zone:%"PRIx64" nsid:%d\n", command,
-                       zsa, (uint64_t)cfg.zslba, cfg.namespace_id);
+               printf("%s: Success, action:%d zone:%"PRIx64" all:%d nsid:%d\n",
+                       command, zsa, (uint64_t)cfg.zslba, (int)cfg.select_all,
+                       cfg.namespace_id);
        else if (err > 0)
                nvme_show_status(err);
        else
@@ -323,8 +324,10 @@ static int zone_mgmt_send(int argc, char **argv, struct command *cmd, struct plu
        err = __zns_mgmt_send(fd, cfg.namespace_id, cfg.zslba, cfg.select_all,
                        cfg.zsa, cfg.data_len, buf);
        if (!err)
-               printf("zone-mgmt-send: Success, action:%d zone:%"PRIx64" nsid:%d\n",
-                       cfg.zsa, (uint64_t)cfg.zslba, cfg.namespace_id);
+               printf("zone-mgmt-send: Success, action:%d zone:%"PRIx64" "
+                       "all:%d nsid:%d\n",
+                       cfg.zsa, (uint64_t)cfg.zslba, (int)cfg.select_all,
+                       cfg.namespace_id);
        else if (err > 0)
                nvme_show_status(err);
        else