From: Daniel Wagner Date: Fri, 12 Apr 2024 10:58:34 +0000 (+0200) Subject: Revert "ioctl: add nvme_set_features_host_id2()" X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d166d073d1aa5c57d79205bb680287d86d34d824;p=users%2Fsagi%2Flibnvme.git Revert "ioctl: add nvme_set_features_host_id2()" This reverts commit 0782b381f3f1d1f1aabbc602aec1be549367b501. 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/libnvme.map b/src/libnvme.map index 85f4a4a1..c2a23e3a 100644 --- a/src/libnvme.map +++ b/src/libnvme.map @@ -12,7 +12,6 @@ LIBNVME_1.9 { nvme_ctrl_get_cntlid; nvme_set_features_timestamp2; nvme_set_features_host_behavior2; - nvme_set_features_host_id2; }; LIBNVME_1_8 { diff --git a/src/nvme/ioctl.c b/src/nvme/ioctl.c index dfd17e46..d54b367c 100644 --- a/src/nvme/ioctl.c +++ b/src/nvme/ioctl.c @@ -717,18 +717,6 @@ int nvme_set_features_sw_progress(int fd, __u8 pbslc, bool save, } int nvme_set_features_host_id(int fd, bool exhid, bool save, __u8 *hostid) -{ - __u32 result = 0; - int err; - - err = nvme_set_features_host_id2(fd, exhid, save, hostid, &result); - if (err && result) - err = result; - return err; -} - -int nvme_set_features_host_id2(int fd, bool exhid, bool save, __u8 *hostid, - __u32 *result) { __u32 len = exhid ? 16 : 8; __u32 value = !!exhid; @@ -745,7 +733,7 @@ int nvme_set_features_host_id2(int fd, bool exhid, bool save, __u8 *hostid, .data_len = len, .data = hostid, .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, - .result = result, + .result = NULL, }; return nvme_set_features(&args); diff --git a/src/nvme/ioctl.h b/src/nvme/ioctl.h index 6978a1f6..f35b2f21 100644 --- a/src/nvme/ioctl.h +++ b/src/nvme/ioctl.h @@ -2903,20 +2903,6 @@ int nvme_set_features_sw_progress(int fd, __u8 pbslc, bool save, */ int nvme_set_features_host_id(int fd, bool exhid, bool save, __u8 *hostid); -/** - * nvme_set_features_host_id2() - Set enable extended host identifiers feature - * @fd: File descriptor of nvme device - * @exhid: Enable Extended Host Identifier - * @save: Save value across power states - * @hostid: Host ID to set - * @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_set_features_host_id2(int fd, bool exhid, bool save, __u8 *hostid, - __u32 *result); - /** * nvme_set_features_resv_mask() - Set reservation notification mask feature *