Skip to content

Commit 24b5ce0

Browse files
committed
nvme: use nvme_ns_rescan instead open coding
Use nvme_ns_rescan which wraps the IOCTL. This in preparation to make the low level code private in libnvme. Signed-off-by: Daniel Wagner <[email protected]>
1 parent d8e19ce commit 24b5ce0

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

nvme.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6808,8 +6808,7 @@ static int format_cmd(int argc, char **argv, struct command *acmd, struct plugin
68086808
printf("Success formatting namespace:%x\n", cfg.namespace_id);
68096809
if (nvme_transport_handle_is_direct(hdl) && cfg.lbaf != prev_lbaf) {
68106810
if (nvme_transport_handle_is_chardev(hdl)) {
6811-
if (ioctl(nvme_transport_handle_get_fd(hdl),
6812-
NVME_IOCTL_RESCAN) < 0) {
6811+
if (nvme_ns_rescan(hdl) < 0) {
68136812
nvme_show_error("failed to rescan namespaces");
68146813
return -errno;
68156814
}

0 commit comments

Comments
 (0)