From f07b63103878c8c973182bf63459e2e1556cc2db Mon Sep 17 00:00:00 2001 From: Caleb Sander Date: Sat, 12 Aug 2023 13:51:18 -0600 Subject: [PATCH] ioctl: remove nsid from nvme_identify_secondary_ctrl_list() 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 --- src/nvme/ioctl.h | 5 ++--- test/test.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/nvme/ioctl.h b/src/nvme/ioctl.h index 4d843bcd..8ce80a0b 100644 --- a/src/nvme/ioctl.h +++ b/src/nvme/ioctl.h @@ -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, diff --git a/test/test.c b/test/test.c index 2f24e1ec..e41fc9d5 100644 --- a/test/test.c +++ b/test/test.c @@ -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 -- 2.50.1