Skip to content

Commit

Permalink
ioctl: Export nvme opcode string return functions
Browse files Browse the repository at this point in the history
To use by nvme-cli since duplicated the function in nvme-cli.

Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t committed Jan 13, 2024
1 parent 480b5ea commit 72d9f96
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/libnvme.map
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ LIBNVME_1_7 {
nvme_generate_tls_key_identity;
nvme_set_latency;
nvme_get_latency;
nvme_admin_to_string;
nvme_nvm_to_string;
};

LIBNVME_1_6 {
Expand Down
2 changes: 1 addition & 1 deletion src/nvme/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ const char *nvme_nvm_to_string(__u8 opcode)
return NULL;
}

const char *nvme_cmd_to_string(bool admin, __u8 opcode)
static const char *nvme_cmd_to_string(bool admin, __u8 opcode)
{
const char *cmd_name;

Expand Down
22 changes: 20 additions & 2 deletions src/nvme/ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -4049,7 +4049,7 @@ int nvme_dim_send(struct nvme_dim_args *args);

/**
* nvme_set_debug - Set NVMe command debugging output
* @debug: true to enable or false to disable
* @debug: true to enable or false to disable
*/
void nvme_set_debug(bool debug);

Expand All @@ -4062,7 +4062,7 @@ bool nvme_get_debug(void);

/**
* nvme_set_latency - Set NVMe command latency output
* @latency: true to enable or false to disable
* @latency: true to enable or false to disable
*/
void nvme_set_latency(bool latency);

Expand All @@ -4072,4 +4072,22 @@ void nvme_set_latency(bool latency);
* Return: false if disabled or true if enabled.
*/
bool nvme_get_latency(void);

/**
* nvme_admin_to_string - Returns string describing nvme admin opcode
* @opcode: Admin opcode for an nvme command
*
* Return: representation of the admin opcode if it is an admin opcode field,
* or NULL if opcode is unknown.
*/
const char *nvme_admin_to_string(__u8 opcode);

/**
* nvme_nvm_to_string - Returns string describing nvme nvm opcode
* @opcode: NVM opcode for an nvme command
*
* Return: representation of the nvm opcode if it is an nvm opcode field,
* or NULL if opcode is unknown.
*/
const char *nvme_nvm_to_string(__u8 opcode);
#endif /* _LIBNVME_IOCTL_H */

0 comments on commit 72d9f96

Please sign in to comment.