]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print-json: update JSON verbose output for nvm-id-ctrl
authorMartin George <marting@netapp.com>
Thu, 3 Oct 2024 17:20:24 +0000 (22:50 +0530)
committerDaniel Wagner <wagi@monom.org>
Fri, 4 Oct 2024 08:51:56 +0000 (10:51 +0200)
Update the nvme-id-ctrl JSON verbose output for parity with this
command's normal verbose output.

Signed-off-by: Martin George <marting@netapp.com>
nvme-print-json.c

index cd342470d9c12160c2d9a6bbfdec1896538e3da2..b289073803f93f67d0d4cc0c1929eb83e093eac3 100644 (file)
@@ -3072,6 +3072,15 @@ static void json_nvme_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm)
        obj_add_uint64(r, "dmsl", le64_to_cpu(ctrl_nvm->dmsl));
        obj_add_uint(r, "aocs", le16_to_cpu(ctrl_nvm->aocs));
 
+       if (json_print_ops.flags & VERBOSE) {
+               __u16 rsvd = (ctrl_nvm->aocs & 0xfffe) >> 1;
+               __u8 ralbas = ctrl_nvm->aocs & 0x1;
+
+               if (rsvd)
+                       obj_add_uint(r, "[15:1]: Reserved", rsvd);
+               obj_add_uint(r, "[0:0]: Reporting Allocated LBA Supported", ralbas);
+       }
+
        json_print(r);
 }