]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: use the 'eds' command line option replace the 'cdw11' command line option in...
authorsuzhi.yt <suzhi.yt@antgroup.com>
Wed, 20 Oct 2021 02:34:04 +0000 (10:34 +0800)
committersuzhi.yt <suzhi.yt@antgroup.com>
Wed, 20 Oct 2021 02:34:04 +0000 (10:34 +0800)
Signed-off-by: suzhi.yt <suzhi.yt@antgroup.com>
Documentation/nvme-resv-report.1
Documentation/nvme-resv-report.html
Documentation/nvme-resv-report.txt
completions/_nvme
completions/bash-nvme-completion.sh
nvme-print.c
nvme-print.h
nvme.c

index f9f1fa8e637eb28d83bec74d256fb8b3229f3a04..7a57ecee497b68614ac128a00b3b795bf6a2d79a 100644 (file)
@@ -34,7 +34,7 @@ nvme-resv-report \- Send NVMe Reservation Report, parse the result
 .nf
 \fInvme resv\-report\fR <device> [\-\-namespace\-id=<nsid> | \-n <nsid>]
                         [\-\-numd=<num\-dwords> | \-d <num\-dwords>]
-                        [\-\-cdw11=<cdw11> | \-c <cdw11>]
+                        [\-\-eds | \-e]
                         [\-\-raw\-binary | \-b]
                         [\-\-output\-format=<fmt> | \-o <fmt>]
 .fi
@@ -55,9 +55,10 @@ Retrieve the reservation report structure for the given nsid\&. This is required
 Specify the number of Dwords of the Reservation Status structure to transfer\&. Defaults to 4k\&.
 .RE
 .PP
-\-c <cdw11>, \-\-cdw11=<cdw11>
+\-e, \-\-eds
 .RS 4
-The value for command dword 11\&. Setting bit 0 specifies that the controller returns the Extended Data Structure\&.
+Request extended Data Structure: If this bit is set to a
+\fI1\fR, then the controller returns the Extended Data Structure\&.
 .RE
 .PP
 \-b, \-\-raw\-binary
index 83655ae29062ce2e163f117049c5ed9b8e1bdd46..6fb35f628b1d78cf0ea5a19e083ba64741f9b09f 100644 (file)
@@ -751,7 +751,7 @@ nvme-resv-report(1) Manual Page
 <div class="verseblock">\r
 <pre class="content"><em>nvme resv-report</em> &lt;device&gt; [--namespace-id=&lt;nsid&gt; | -n &lt;nsid&gt;]\r
                         [--numd=&lt;num-dwords&gt; | -d &lt;num-dwords&gt;]\r
-                        [--cdw11=&lt;cdw11&gt; | -c &lt;cdw11&gt;]\r
+                        [--eds | -e]\r
                         [--raw-binary | -b]\r
                         [--output-format=&lt;fmt&gt; | -o &lt;fmt&gt;]</pre>\r
 <div class="attribution">\r
@@ -800,14 +800,14 @@ Controller data structure for each such controller).</p></div>
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
--c &lt;cdw11&gt;\r
+-e\r
 </dt>\r
 <dt class="hdlist1">\r
---cdw11=&lt;cdw11&gt;\r
+--eds\r
 </dt>\r
 <dd>\r
 <p>\r
-        The value for command dword 11. Setting bit 0 specifies that the\r
+        Request extended Data Structure: If this bit is set to a '1', then the\r
         controller returns the Extended Data Structure.\r
 </p>\r
 </dd>\r
index b53c14101a3ffdd3edd3d6a24aa182d83cc2c50b..32012fed430b7eb6f1fa5996c3e18ae46fef7616 100644 (file)
@@ -10,7 +10,7 @@ SYNOPSIS
 [verse]
 'nvme resv-report' <device> [--namespace-id=<nsid> | -n <nsid>]
                        [--numd=<num-dwords> | -d <num-dwords>]
-                       [--cdw11=<cdw11> | -c <cdw11>]
+                       [--eds | -e]
                        [--raw-binary | -b]
                        [--output-format=<fmt> | -o <fmt>]
 
@@ -38,9 +38,9 @@ OPTIONS
        Specify the number of Dwords of the Reservation Status structure
        to transfer. Defaults to 4k.
 
--c <cdw11>::
---cdw11=<cdw11>::
-       The value for command dword 11. Setting bit 0 specifies that the 
+-e::
+--eds::
+       Request extended Data Structure: If this bit is set to a '1', then the
        controller returns the Extended Data Structure.
 
 -b::
index 4b388d8ce33d8a9106f3550e1749994b9e52aa1d..db96baa3d9540cfb9e43b26cf752df9d951d99f0 100644 (file)
@@ -596,6 +596,8 @@ _nvme () {
                        -n':alias of --namespace-id'
                        --numd=':number of dwords of reservation status to xfer'
                        -d':alias of --numd'
+                       --eds':request extended data structure'
+                       -e':alias of --eds'
                        --raw-binary':dump output in binary format'
                        -b':alias of --raw-binary'
                        )
index 9eed8e8c34448506c2b4657a3a7ffbac0ddeafce..19fd876b8d8066063d903dcc2366e0d466589908 100644 (file)
@@ -167,8 +167,8 @@ nvme_list_opts () {
                        --rrela= -a --iekey -i"
                        ;;
                "resv-report")
-               opts+=" --namespace-id= -n --numd= -d --raw-binary= -b \
-                       --output-format= -o"
+               opts+=" --namespace-id= -n --numd= -d --eds -e \
+                       --raw-binary= -b --output-format= -o"
                        ;;
                "dsm")
                opts+=" --namespace-id= -n --ctx-attrs= -a --blocks= -b\
index 6c330d89a441bbb1b19ca713fd66cf9e195c5d36..0867476151182f682d58375c5a20c2979644c665 100644 (file)
@@ -416,7 +416,7 @@ static void json_error_log(struct nvme_error_log_page *err_log, int entries)
 }
 
 static void json_nvme_resv_report(struct nvme_resv_status *status,
-                                 int bytes, __u32 cdw11)
+                                 int bytes, bool eds)
 {
        struct json_object *root;
        struct json_object *rcs;
@@ -433,7 +433,7 @@ static void json_nvme_resv_report(struct nvme_resv_status *status,
 
        rcs = json_create_array();
        /* check Extended Data Structure bit */
-       if ((cdw11 & 0x1) == 0) {
+       if (!eds) {
                /*
                 * if status buffer was too small, don't loop past the end of
                 * the buffer
@@ -4613,14 +4613,14 @@ void nvme_show_error_log(struct nvme_error_log_page *err_log, int entries,
 }
 
 void nvme_show_resv_report(struct nvme_resv_status *status, int bytes,
-       __u32 cdw11, enum nvme_print_flags flags)
+       bool eds, enum nvme_print_flags flags)
 {
        int i, j, regctl, entries;
 
        if (flags & BINARY)
                return d_raw((unsigned char *)status, bytes);
        else if (flags & JSON)
-               return json_nvme_resv_report(status, bytes, cdw11);
+               return json_nvme_resv_report(status, bytes, eds);
 
        regctl = status->regctl[0] | (status->regctl[1] << 8);
 
@@ -4631,7 +4631,7 @@ void nvme_show_resv_report(struct nvme_resv_status *status, int bytes,
        printf("ptpls     : %d\n", status->ptpls);
 
        /* check Extended Data Structure bit */
-       if ((cdw11 & 0x1) == 0) {
+       if (!eds) {
                /*
                 * if status buffer was too small, don't loop past the end of
                 * the buffer
index 7bc8a84dd3b3812fa66fd3747016514f43a5bb22..33ab3f97f7dfea3a7c77f0261bbc55d2104c23b8 100644 (file)
@@ -23,7 +23,7 @@ void __nvme_show_id_ctrl(struct nvme_id_ctrl *ctrl, unsigned int mode,
 void nvme_show_id_ctrl(struct nvme_id_ctrl *ctrl, unsigned int mode);
 void nvme_show_id_ns(struct nvme_id_ns *ns, unsigned int nsid,
        enum nvme_print_flags flags);
-void nvme_show_resv_report(struct nvme_resv_status *status, int bytes, __u32 cdw11,
+void nvme_show_resv_report(struct nvme_resv_status *status, int bytes, bool eds,
        enum nvme_print_flags flags);
 void nvme_show_lba_range(struct nvme_lba_range_type *lbrt, int nr_ranges);
 void nvme_show_error_log(struct nvme_error_log_page *err_log, int entries,
diff --git a/nvme.c b/nvme.c
index 04de39359dbae574f282ebb80b8fde63e5cd4bf3..611e920bad0ef205e58932b63a80adf643492b28 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -4739,7 +4739,7 @@ static int resv_report(int argc, char **argv, struct command *cmd, struct plugin
                "namespace.";
        const char *namespace_id = "identifier of desired namespace";
        const char *numd = "number of dwords to transfer";
-       const char *cdw11 = "command dword 11 value";
+       const char *eds = "request extended data structure";
        const char *raw = "dump output in binary format";
 
        struct nvme_resv_status *status;
@@ -4749,7 +4749,7 @@ static int resv_report(int argc, char **argv, struct command *cmd, struct plugin
        struct config {
                __u32 namespace_id;
                __u32 numd;
-               __u32 cdw11;
+               __u8  eds;
                int   raw_binary;
                char *output_format;
        };
@@ -4757,14 +4757,14 @@ static int resv_report(int argc, char **argv, struct command *cmd, struct plugin
        struct config cfg = {
                .namespace_id = 0,
                .numd         = 0,
-               .cdw11        = 0,
+               .eds          = 0,
                .output_format = "normal",
        };
 
        OPT_ARGS(opts) = {
                OPT_UINT("namespace-id",  'n', &cfg.namespace_id,   namespace_id),
                OPT_UINT("numd",          'd', &cfg.numd,           numd),
-               OPT_UINT("cdw11",         'c', &cfg.cdw11,          cdw11),
+               OPT_FLAG("eds",           'e', &cfg.eds,            eds),
                OPT_FMT("output-format",  'o', &cfg.output_format,  output_format),
                OPT_FLAG("raw-binary",    'b', &cfg.raw_binary,     raw),
                OPT_END()
@@ -4802,9 +4802,9 @@ static int resv_report(int argc, char **argv, struct command *cmd, struct plugin
        }
        memset(status, 0, size);
 
-       err = nvme_resv_report(fd, cfg.namespace_id, cfg.cdw11, size, status);
+       err = nvme_resv_report(fd, cfg.namespace_id, cfg.eds, size, status);
        if (!err)
-               nvme_show_resv_report(status, size, cfg.cdw11, flags);
+               nvme_show_resv_report(status, size, cfg.eds, flags);
        else if (err > 0)
                nvme_show_status(err);
        else