]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
Revert "ioctl: add nvme_set_features_host_id2()"
authorDaniel Wagner <dwagner@suse.de>
Fri, 12 Apr 2024 10:58:34 +0000 (12:58 +0200)
committerDaniel Wagner <wagi@monom.org>
Fri, 12 Apr 2024 11:17:54 +0000 (13:17 +0200)
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 <dwagner@suse.de>
src/libnvme.map
src/nvme/ioctl.c
src/nvme/ioctl.h

index 85f4a4a17a589bbab6c42a322fc6057f9ef34ff9..c2a23e3aa434a805a112b5a613df4952e5459eec 100644 (file)
@@ -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 {
index dfd17e46d78eca1efd91ed6b32f4daf77693c181..d54b367ccfc024fada5f54cac83da79bd272e57a 100644 (file)
@@ -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);
index 6978a1f6dade85caaba5bdc3e4c4b53bc42248ac..f35b2f21771a2d42eccedb844bf2075707a50a17 100644 (file)
@@ -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
  *