]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
Revert "ioctl: add nvme_get_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 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 <dwagner@suse.de>
src/nvme/ioctl.c
src/nvme/ioctl.h

index ba475496f651f44371950c4a985b2528283894d5..ab36a4b5b4b4628536f2ddc5c7cf7073ded23016 100644 (file)
@@ -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);
index 5a1760d9e83554a8423307d251515b75107b02c6..5f234e7000d80fc021bc226cc06ba5511d3f323e 100644 (file)
@@ -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