From: Daniel Wagner Date: Fri, 12 Apr 2024 10:58:34 +0000 (+0200) Subject: Revert "ioctl: add nvme_get_features_host_id2()" X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=933a65e04ac5f4253976c4fc575cddc162ab70a8;p=users%2Fsagi%2Flibnvme.git Revert "ioctl: add nvme_get_features_host_id2()" This reverts commit 3d9ab1d2217af69a0285efde2c0c0ee211bdca60. The result field is undefined for many commands and thus can have random values. Thus we can't blindly evaluate these for all commands. Signed-off-by: Daniel Wagner --- diff --git a/src/nvme/ioctl.c b/src/nvme/ioctl.c index ba475496..ab36a4b5 100644 --- a/src/nvme/ioctl.c +++ b/src/nvme/ioctl.c @@ -1194,19 +1194,7 @@ int nvme_get_features_sw_progress(int fd, enum nvme_get_features_sel sel, } int nvme_get_features_host_id(int fd, enum nvme_get_features_sel sel, - bool exhid, __u32 len, __u8 *hostid) -{ - __u32 result = 0; - int err; - - err = nvme_get_features_host_id2(fd, sel, exhid, len, hostid, &result); - if (err && result) - err = result; - return err; -} - -int nvme_get_features_host_id2(int fd, enum nvme_get_features_sel sel, - bool exhid, __u32 len, __u8 *hostid, __u32 *result) + bool exhid, __u32 len, __u8 *hostid) { struct nvme_get_features_args args = { .args_size = sizeof(args), @@ -1219,7 +1207,7 @@ int nvme_get_features_host_id2(int fd, enum nvme_get_features_sel sel, .data_len = len, .data = hostid, .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, - .result = result, + .result = NULL, }; return nvme_get_features(&args); diff --git a/src/nvme/ioctl.h b/src/nvme/ioctl.h index 5a1760d9..5f234e70 100644 --- a/src/nvme/ioctl.h +++ b/src/nvme/ioctl.h @@ -3479,22 +3479,7 @@ int nvme_get_features_sw_progress(int fd, enum nvme_get_features_sel sel, * &enum nvme_status_field) or -1 with errno set otherwise. */ int nvme_get_features_host_id(int fd, enum nvme_get_features_sel sel, - bool exhid, __u32 len, __u8 *hostid); - -/** - * nvme_get_features_host_id2() - Get host id feature - * @fd: File descriptor of nvme device - * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel - * @exhid: Enable Extended Host Identifier - * @len: Length of @hostid - * @hostid: Buffer for returned host ID - * @result: The command completion result from CQE dword0 - * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, or -1 with errno set otherwise. - */ -int nvme_get_features_host_id2(int fd, enum nvme_get_features_sel sel, - bool exhid, __u32 len, __u8 *hostid, __u32 *result); + bool exhid, __u32 len, __u8 *hostid); /** * nvme_get_features_resv_mask() - Get reservation mask feature