From 1826dc7191def097f5f6db87ca88e42fc1098803 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Fri, 12 Apr 2024 12:58:34 +0200 Subject: [PATCH] Revert "ioctl: add nvme_set_features_iocs_profile2()" This reverts commit cb9bdfd4f15305b5d2868aea7f642e211e5a2f36. 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 --- src/libnvme.map | 1 - src/nvme/ioctl.c | 16 +--------------- src/nvme/ioctl.h | 13 ------------- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/src/libnvme.map b/src/libnvme.map index e5dd410d..85f4a4a1 100644 --- a/src/libnvme.map +++ b/src/libnvme.map @@ -13,7 +13,6 @@ LIBNVME_1.9 { nvme_set_features_timestamp2; nvme_set_features_host_behavior2; nvme_set_features_host_id2; - nvme_set_features_iocs_profile2; }; LIBNVME_1_8 { diff --git a/src/nvme/ioctl.c b/src/nvme/ioctl.c index 34080274..dfd17e46 100644 --- a/src/nvme/ioctl.c +++ b/src/nvme/ioctl.c @@ -793,25 +793,11 @@ int nvme_set_features_write_protect2(int fd, __u32 nsid, } int nvme_set_features_iocs_profile(int fd, __u16 iocsi, bool save) -{ - __u32 value = NVME_SET(iocsi, FEAT_IOCSP_IOCSCI); - __u32 result = 0; - int err; - - err = __nvme_set_features(fd, NVME_FEAT_FID_IOCS_PROFILE, value, - save, &result); - if (err && result) - err = result; - return err; -} - -int nvme_set_features_iocs_profile2(int fd, __u16 iocsi, bool save, - __u32 *result) { __u32 value = NVME_SET(iocsi, FEAT_IOCSP_IOCSCI); return __nvme_set_features(fd, NVME_FEAT_FID_IOCS_PROFILE, value, - save, result); + save, NULL); } int nvme_get_features(struct nvme_get_features_args *args) diff --git a/src/nvme/ioctl.h b/src/nvme/ioctl.h index f0d2a70f..6978a1f6 100644 --- a/src/nvme/ioctl.h +++ b/src/nvme/ioctl.h @@ -3023,19 +3023,6 @@ int nvme_set_features_write_protect2(int fd, __u32 nsid, */ int nvme_set_features_iocs_profile(int fd, __u16 iocsi, bool save); -/** - * nvme_set_features_iocs_profile2() - Set I/O command set profile feature - * @fd: File descriptor of nvme device - * @iocsi: I/O Command Set Combination Index - * @save: Save value across power states - * @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_iocs_profile2(int fd, __u16 iocsi, bool save, - __u32 *result); - /** * nvme_get_features() - Retrieve a feature attribute * @args: &struct nvme_get_features_args argument structure -- 2.50.1