Skip to content

Commit 772db1c

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 a97dd75 commit 772db1c

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
@@ -6821,8 +6821,7 @@ static int format_cmd(int argc, char **argv, struct command *acmd, struct plugin
68216821
printf("Success formatting namespace:%x\n", cfg.namespace_id);
68226822
if (nvme_transport_handle_is_direct(hdl) && cfg.lbaf != prev_lbaf) {
68236823
if (nvme_transport_handle_is_chardev(hdl)) {
6824-
if (ioctl(nvme_transport_handle_get_fd(hdl),
6825-
NVME_IOCTL_RESCAN) < 0) {
6824+
if (nvme_ns_rescan(hdl) < 0) {
68266825
nvme_show_error("failed to rescan namespaces");
68276826
return -errno;
68286827
}

0 commit comments

Comments
 (0)