Skip to content

Commit 0c06e40

Browse files
dwsuseigaw
authored andcommitted
Revert "ioctl: add nvme_set_features_host_behavior2()"
This reverts commit eff57ae. 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 <[email protected]>
1 parent d166d07 commit 0c06e40

3 files changed

Lines changed: 5 additions & 31 deletions

File tree

src/libnvme.map

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ LIBNVME_1.9 {
1111
nvme_update_key;
1212
nvme_ctrl_get_cntlid;
1313
nvme_set_features_timestamp2;
14-
nvme_set_features_host_behavior2;
1514
};
1615

1716
LIBNVME_1_8 {

src/nvme/ioctl.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -661,19 +661,7 @@ int nvme_set_features_lba_sts_interval(int fd, __u16 lsiri, __u16 lsipi,
661661
}
662662

663663
int nvme_set_features_host_behavior(int fd, bool save,
664-
struct nvme_feat_host_behavior *data)
665-
{
666-
__u32 result = 0;
667-
int err;
668-
669-
err = nvme_set_features_host_behavior2(fd, save, data, &result);
670-
if (err && result)
671-
err = result;
672-
return err;
673-
}
674-
675-
int nvme_set_features_host_behavior2(int fd, bool save,
676-
struct nvme_feat_host_behavior *data, __u32 *result)
664+
struct nvme_feat_host_behavior *data)
677665
{
678666
struct nvme_set_features_args args = {
679667
.args_size = sizeof(args),
@@ -688,7 +676,7 @@ int nvme_set_features_host_behavior2(int fd, bool save,
688676
.data_len = sizeof(*data),
689677
.data = data,
690678
.timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
691-
.result = result,
679+
.result = NULL,
692680
};
693681

694682
return nvme_set_features(&args);

src/nvme/ioctl.h

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2833,24 +2833,10 @@ int nvme_set_features_lba_sts_interval(int fd, __u16 lsiri, __u16 lsipi,
28332833
* @save: Save value across power states
28342834
* @data: Pointer to structure nvme_feat_host_behavior
28352835
*
2836-
* Return: The nvme command status if a response was received (see
2837-
* &enum nvme_status_field) or -1 with errno set otherwise.
2836+
* Return: 0 if the ioctl was successful or -1 with errno set otherwise.
28382837
*/
28392838
int nvme_set_features_host_behavior(int fd, bool save,
2840-
struct nvme_feat_host_behavior *data);
2841-
2842-
/**
2843-
* nvme_set_features_host_behavior2() - Set host behavior feature
2844-
* @fd: File descriptor of nvme device
2845-
* @save: Save value across power states
2846-
* @data: Pointer to structure nvme_feat_host_behavior
2847-
* @result: The command completion result from CQE dword0
2848-
*
2849-
* Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when
2850-
* a non-zero state is returned in @result, or -1 with errno set otherwise.
2851-
*/
2852-
int nvme_set_features_host_behavior2(int fd, bool save,
2853-
struct nvme_feat_host_behavior *data, __u32 *result);
2839+
struct nvme_feat_host_behavior *data);
28542840

28552841
/**
28562842
* nvme_set_features_sanitize() - Set sanitize feature
@@ -2861,6 +2847,7 @@ int nvme_set_features_host_behavior2(int fd, bool save,
28612847
*
28622848
* Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when
28632849
* a non-zero state is returned in @result, or -1 with errno set otherwise.
2850+
* Return: 0 if the ioctl was successful or -1 with errno set otherwise.
28642851
*/
28652852
int nvme_set_features_sanitize(int fd, bool nodrm, bool save, __u32 *result);
28662853

0 commit comments

Comments
 (0)