From: Hannes Reinecke Date: Mon, 14 Jun 2021 11:39:13 +0000 (+0200) Subject: ioctl: add 'nsid' parameter to nvme_identify_secondary_ctrl_list() X-Git-Tag: v1.0-rc0~127^2~5 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=37989a237a58f33f822f1551c46770c0c83ae819;p=users%2Fsagi%2Flibnvme.git ioctl: add 'nsid' parameter to nvme_identify_secondary_ctrl_list() nvme_identify_secondary_ctrl_list() can relate to specific nsids, so allow the nsid parameter to be settable. Signed-off-by: Hannes Reinecke --- diff --git a/src/nvme/ioctl.c b/src/nvme/ioctl.c index f4960f6f..edc4433b 100644 --- a/src/nvme/ioctl.c +++ b/src/nvme/ioctl.c @@ -456,12 +456,12 @@ int nvme_identify_primary_ctrl(int fd, __u16 cntid, NVME_UUID_NONE, NVME_CSI_NVM, cap); } -int nvme_identify_secondary_ctrl_list(int fd, __u16 cntid, +int nvme_identify_secondary_ctrl_list(int fd, __u32 nsid, __u16 cntid, struct nvme_secondary_ctrl_list *list) { BUILD_ASSERT(sizeof(struct nvme_secondary_ctrl_list) == 4096); return nvme_identify(fd, NVME_IDENTIFY_CNS_SECONDARY_CTRL_LIST, - NVME_NSID_NONE, cntid, NVME_NVMSETID_NONE, + nsid, cntid, NVME_NVMSETID_NONE, NVME_UUID_NONE, NVME_CSI_NVM, list); } diff --git a/src/nvme/ioctl.h b/src/nvme/ioctl.h index 2878cd01..ef6faf1d 100644 --- a/src/nvme/ioctl.h +++ b/src/nvme/ioctl.h @@ -985,6 +985,7 @@ 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 * @@ -999,7 +1000,7 @@ 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. */ -int nvme_identify_secondary_ctrl_list(int fd, __u16 cntid, +int nvme_identify_secondary_ctrl_list(int fd, __u32 nsid, __u16 cntid, struct nvme_secondary_ctrl_list *list); /** diff --git a/test/test.c b/test/test.c index fc9c21ef..7c6a5cb8 100644 --- a/test/test.c +++ b/test/test.c @@ -101,7 +101,7 @@ static int test_ctrl(nvme_ctrl_t c) printf(" Identify Primary:\n"); else printf(" ERROR: Identify Primary:%x\n", ret); - ret = nvme_identify_secondary_ctrl_list(fd, 0, &sec); + ret = nvme_identify_secondary_ctrl_list(fd, 1, 0, &sec); if (!ret) printf(" Identify Secondary:\n"); else