Skip to content

Commit 1b8477d

Browse files
calebsanderigaw
authored andcommitted
ioctl: export nvme_{g,s}et_features_iocs_profile()
nvme_get_features_iocs_profile() and nvme_set_features_iocs_profile() are defined but not exorted in libnvme.so. nvme_set_features_iocs_profile()'s prototype was also removed, so add it back. IOCSI is a 9-bit value, so fix its bitmask and change its type to u16. Signed-off-by: Caleb Sander <[email protected]>
1 parent db619f7 commit 1b8477d

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

src/libnvme.map

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ LIBNVME_1_6 {
66
nvme_ctrl_get_src_addr;
77
nvme_ctrl_release_fd;
88
nvme_get_features_host_mem_buf2;
9+
nvme_get_features_iocs_profile;
910
nvme_host_release_fds;
1011
nvme_ns_release_fd;
1112
nvme_root_release_fds;
13+
nvme_set_features_iocs_profile;
1214
nvme_subsystem_get_iopolicy;
1315
nvme_subsystem_release_fds;
1416
nvme_set_debug;

src/nvme/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ int nvme_set_features_write_protect(int fd, enum nvme_feat_nswpcfg_state state,
887887
false, result);
888888
}
889889

890-
int nvme_set_features_iocs_profile(int fd, __u8 iocsi, bool save)
890+
int nvme_set_features_iocs_profile(int fd, __u16 iocsi, bool save)
891891
{
892892
__u32 value = NVME_SET(iocsi, FEAT_IOCSP_IOCSCI);
893893

src/nvme/ioctl.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2551,6 +2551,17 @@ int nvme_set_features_resv_persist(int fd, bool ptpl, bool save, __u32 *result);
25512551
int nvme_set_features_write_protect(int fd, enum nvme_feat_nswpcfg_state state,
25522552
bool save, __u32 *result);
25532553

2554+
/**
2555+
* nvme_set_features_iocs_profile() - Set I/O command set profile feature
2556+
* @fd: File descriptor of nvme device
2557+
* @iocsi: I/O Command Set Combination Index
2558+
* @save: Save value across power states
2559+
*
2560+
* Return: The nvme command status if a response was received (see
2561+
* &enum nvme_status_field) or -1 with errno set otherwise.
2562+
*/
2563+
int nvme_set_features_iocs_profile(int fd, __u16 iocsi, bool save);
2564+
25542565
/**
25552566
* nvme_get_features() - Retrieve a feature attribute
25562567
* @args: &struct nvme_get_features_args argument structure

src/nvme/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7020,7 +7020,7 @@ enum nvme_feat {
70207020
NVME_FEAT_WP_WPS_SHIFT = 0,
70217021
NVME_FEAT_WP_WPS_MASK = 0x7,
70227022
NVME_FEAT_IOCSP_IOCSCI_SHIFT = 0,
7023-
NVME_FEAT_IOCSP_IOCSCI_MASK = 0xff,
7023+
NVME_FEAT_IOCSP_IOCSCI_MASK = 0x1ff,
70247024
NVME_FEAT_FDP_ENABLED_SHIFT = 0,
70257025
NVME_FEAT_FDP_ENABLED_MASK = 0x1,
70267026
NVME_FEAT_FDP_INDEX_SHIFT = 8,

0 commit comments

Comments
 (0)