]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
ioctl: remove nsid from nvme_identify_secondary_ctrl_list()
authorCaleb Sander <csander@purestorage.com>
Sat, 12 Aug 2023 19:51:18 +0000 (13:51 -0600)
committerDaniel Wagner <wagi@monom.org>
Thu, 17 Aug 2023 12:56:12 +0000 (14:56 +0200)
According to the NVMe specification, Identify CNS value 15h
("Secondary Controller list of controllers associated with
the primary controller processing the command")
does not use the NSID field.
So remove the "nsid" argument from nvme_identify_secondary_ctrl_list().

Signed-off-by: Caleb Sander <csander@purestorage.com>
src/nvme/ioctl.h
test/test.c

index 4d843bcd8216da1abe0a3769097611bc9eed3e27..8ce80a0bd1686344947d299066ae41a1d550aa8b 100644 (file)
@@ -748,7 +748,6 @@ static inline int nvme_identify_primary_ctrl(int fd, __u16 cntid,
 /**
  * nvme_identify_secondary_ctrl_list() - Retrieves secondary controller list
  * @fd:                File descriptor of nvme device
- * @nsid:      Namespace identifier
  * @cntid:     Return controllers starting at this identifier
  * @sc_list:   User space destination address to transfer the data
  *
@@ -763,7 +762,7 @@ static inline int nvme_identify_primary_ctrl(int fd, __u16 cntid,
  * Return: The nvme command status if a response was received (see
  * &enum nvme_status_field) or -1 with errno set otherwise.
  */
-static inline int nvme_identify_secondary_ctrl_list(int fd, __u32 nsid,
+static inline int nvme_identify_secondary_ctrl_list(int fd,
                        __u16 cntid, struct nvme_secondary_ctrl_list *sc_list)
 {
        struct nvme_identify_args args = {
@@ -774,7 +773,7 @@ static inline int nvme_identify_secondary_ctrl_list(int fd, __u32 nsid,
                .timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
                .cns = NVME_IDENTIFY_CNS_SECONDARY_CTRL_LIST,
                .csi = NVME_CSI_NVM,
-               .nsid = nsid,
+               .nsid = NVME_NSID_NONE,
                .cntid = cntid,
                .cns_specific_id = NVME_CNSSPECID_NONE,
                .uuidx = NVME_UUID_NONE,
index 2f24e1ecf1155f612a96e3fcb90e2110c297215c..e41fc9d55491c25a96140ec3e61b6a5771c9c8d9 100644 (file)
@@ -112,7 +112,7 @@ static int test_ctrl(nvme_ctrl_t c)
                printf("  PASSED: Identify Primary\n");
        else
                printf("  ERROR: Identify Primary:%x\n", ret);
-       ret = nvme_identify_secondary_ctrl_list(fd, 1, 0, &sec);
+       ret = nvme_identify_secondary_ctrl_list(fd, 0, &sec);
        if (!ret)
                printf("  PASSED: Identify Secondary\n");
        else