@@ -212,7 +212,7 @@ static const char *mo = "management operation";
212212static const char * namespace_desired = "desired namespace" ;
213213static const char * namespace_id_optional = "optional namespace attached to controller" ;
214214static const char * nssf = "NVMe Security Specific Field" ;
215- static const char * only_char_dev = "Only character device is allowed" ;
215+ static const char * only_ctrl_dev = "Only controller device is allowed" ;
216216static const char * prinfo = "PI and check field" ;
217217static const char * rae = "Retain an Asynchronous Event" ;
218218static const char * raw_directive = "show directive in binary format" ;
@@ -422,11 +422,11 @@ static int open_fallback_chardev(struct libnvme_global_ctx *ctx,
422422 struct libnvme_transport_handle * hdl = * phdl ;
423423 int err ;
424424
425- if (libnvme_transport_handle_is_chardev (hdl )) {
425+ if (libnvme_transport_handle_is_ctrl (hdl )) {
426426 __cleanup_free char * cdev = NULL ;
427427
428428 if (!nsid ) {
429- nvme_show_error ("char device not supported without --namespace-id" );
429+ nvme_show_error ("controller device not supported without --namespace-id" );
430430 return - EINVAL ;
431431 }
432432
@@ -1099,8 +1099,8 @@ static int get_effects_log(int argc, char **argv, struct command *acmd, struct p
10991099
11001100 if (cfg .csi < 0 ) {
11011101 __u64 cap ;
1102- if (libnvme_transport_handle_is_blkdev (hdl )) {
1103- nvme_show_error ("Block device isn't allowed without csi" );
1102+ if (libnvme_transport_handle_is_ns (hdl )) {
1103+ nvme_show_error ("Namespace device isn't allowed without csi" );
11041104 return - EINVAL ;
11051105 }
11061106 bar = mmap_registers (hdl , false);
@@ -3013,8 +3013,8 @@ static int nvme_attach_ns(int argc, char **argv, int attach, const char *desc, s
30133013 return err ;
30143014 }
30153015
3016- if (libnvme_transport_handle_is_blkdev (hdl )) {
3017- nvme_show_error ("%s: a block device opened (dev: %s, nsid: %d)" , acmd -> name ,
3016+ if (libnvme_transport_handle_is_ns (hdl )) {
3017+ nvme_show_error ("%s: a namespace device opened (dev: %s, nsid: %d)" , acmd -> name ,
30183018 libnvme_transport_handle_get_name (hdl ), cfg .nsid );
30193019 return - EINVAL ;
30203020 }
@@ -5437,8 +5437,8 @@ static int subsystem_reset(int argc, char **argv, struct command *acmd, struct p
54375437 if (err )
54385438 return err ;
54395439
5440- if (!libnvme_transport_handle_is_chardev (hdl )) {
5441- nvme_show_error (only_char_dev );
5440+ if (!libnvme_transport_handle_is_ctrl (hdl )) {
5441+ nvme_show_error (only_ctrl_dev );
54425442 return - EINVAL ;
54435443 }
54445444
@@ -5468,8 +5468,8 @@ static int reset(int argc, char **argv, struct command *acmd, struct plugin *plu
54685468 if (err )
54695469 return err ;
54705470
5471- if (!libnvme_transport_handle_is_chardev (hdl )) {
5472- nvme_show_error (only_char_dev );
5471+ if (!libnvme_transport_handle_is_ctrl (hdl )) {
5472+ nvme_show_error (only_ctrl_dev );
54735473 return - EINVAL ;
54745474 }
54755475
@@ -5497,8 +5497,8 @@ static int ns_rescan(int argc, char **argv, struct command *acmd, struct plugin
54975497 if (err )
54985498 return err ;
54995499
5500- if (!libnvme_transport_handle_is_chardev (hdl )) {
5501- nvme_show_error (only_char_dev );
5500+ if (!libnvme_transport_handle_is_ctrl (hdl )) {
5501+ nvme_show_error (only_ctrl_dev );
55025502 return - EINVAL ;
55035503 }
55045504
@@ -5860,8 +5860,8 @@ static int show_registers(int argc, char **argv, struct command *acmd, struct pl
58605860 if (err )
58615861 return err ;
58625862
5863- if (libnvme_transport_handle_is_blkdev (hdl )) {
5864- nvme_show_error (only_char_dev );
5863+ if (libnvme_transport_handle_is_ns (hdl )) {
5864+ nvme_show_error (only_ctrl_dev );
58655865 return - EINVAL ;
58665866 }
58675867
@@ -6137,8 +6137,8 @@ static int get_register(int argc, char **argv, struct command *acmd, struct plug
61376137 if (err )
61386138 return err ;
61396139
6140- if (libnvme_transport_handle_is_blkdev (hdl )) {
6141- nvme_show_error (only_char_dev );
6140+ if (libnvme_transport_handle_is_ns (hdl )) {
6141+ nvme_show_error (only_ctrl_dev );
61426142 return - EINVAL ;
61436143 }
61446144
@@ -6441,8 +6441,8 @@ static int set_register(int argc, char **argv, struct command *acmd, struct plug
64416441 if (err )
64426442 return err ;
64436443
6444- if (libnvme_transport_handle_is_blkdev (hdl )) {
6445- nvme_show_error (only_char_dev );
6444+ if (libnvme_transport_handle_is_ns (hdl )) {
6445+ nvme_show_error (only_ctrl_dev );
64466446 return - EINVAL ;
64476447 }
64486448
@@ -6798,7 +6798,7 @@ static int format_cmd(int argc, char **argv, struct command *acmd, struct plugin
67986798
67996799 printf ("Success formatting namespace:%x\n" , cfg .namespace_id );
68006800 if (libnvme_transport_handle_is_direct (hdl ) && cfg .lbaf != prev_lbaf ) {
6801- if (libnvme_transport_handle_is_chardev (hdl )) {
6801+ if (libnvme_transport_handle_is_ctrl (hdl )) {
68026802 if (libnvme_rescan_ns (hdl ) < 0 ) {
68036803 nvme_show_error ("failed to rescan namespaces" );
68046804 return - errno ;
@@ -6830,7 +6830,7 @@ static int format_cmd(int argc, char **argv, struct command *acmd, struct plugin
68306830 }
68316831 }
68326832 if (libnvme_transport_handle_is_direct (hdl ) && cfg .reset &&
6833- libnvme_transport_handle_is_chardev (hdl ))
6833+ libnvme_transport_handle_is_ctrl (hdl ))
68346834 libnvme_reset_ctrl (hdl );
68356835
68366836 return err ;
0 commit comments