]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
Revert "ioctl: add nvme_set_features_timestamp2()"
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 99d5e26bb4014830a4a5649bd200f9fcc199990b.

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 b3c872019de7c07dbb831547b280cd4a755092e4..8710c41f5d7ab06db87af990c875af7a63079ba8 100644 (file)
@@ -10,7 +10,6 @@ LIBNVME_1.9 {
                nvme_submit_passthru64;
                nvme_update_key;
                nvme_ctrl_get_cntlid;
-               nvme_set_features_timestamp2;
 };
 
 LIBNVME_1_8 {
index 726171e44e2679f7413e8ff1d2236a482dbd9784..fa7d70d844bf04e0cc255dd9b3b2c2f8ab208b31 100644 (file)
@@ -530,18 +530,6 @@ int nvme_set_features_auto_pst(int fd, bool apste, bool save,
 }
 
 int nvme_set_features_timestamp(int fd, bool save, __u64 timestamp)
-{
-       __u32 result = 0;
-       int err;
-
-       err = nvme_set_features_timestamp2(fd, save, timestamp, &result);
-       if (err && result)
-               err = result;
-       return err;
-}
-
-int nvme_set_features_timestamp2(int fd, bool save, __u64 timestamp,
-               __u32 *result)
 {
        __le64 t = cpu_to_le64(timestamp);
        struct nvme_timestamp ts = {};
@@ -558,7 +546,7 @@ int nvme_set_features_timestamp2(int fd, bool save, __u64 timestamp,
                .data_len = sizeof(ts),
                .data = &ts,
                .timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
-               .result = result,
+               .result = NULL,
        };
 
        memcpy(ts.timestamp, &t, sizeof(ts.timestamp));
index 1584d5515601527846de5113c4960ed8b44ccb14..d3eeb5eaf75616fd9d2774a67536f55c68ab198c 100644 (file)
@@ -2730,19 +2730,6 @@ int nvme_set_features_auto_pst(int fd, bool apste, bool save,
  */
 int nvme_set_features_timestamp(int fd, bool save, __u64 timestamp);
 
-/**
- * nvme_set_features_timestamp2() - Set timestamp feature
- * @fd:                File descriptor of nvme device
- * @save:      Save value across power states
- * @timestamp: The current timestamp value to assign to this feature
- * @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_timestamp2(int fd, bool save, __u64 timestamp,
-               __u32 *result);
-
 /**
  * nvme_set_features_hctm() - Set thermal management feature
  * @fd:                File descriptor of nvme device