diff --git a/scst/include/scst.h b/scst/include/scst.h index e08d52a2a..916dd7658 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -1354,6 +1354,11 @@ struct scst_dev_type { */ unsigned auto_cm_assignment_possible:1; + /* + * Set if this handler does not have run time devices management + */ + unsigned no_mgmt:1; + /* * Called to parse CDB from the cmd and initialize * cmd->bufflen and cmd->data_direction (both - REQUIRED). diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index c2dd44aec..7e9962bcf 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -234,6 +234,7 @@ static const struct file_operations dev_user_fops = { }; static struct scst_dev_type dev_user_devtype = { + .no_mgmt = 1, .name = DEV_USER_NAME, .type = -1, .parse = dev_usr_parse, diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 3eb0199a7..3b3047d7c 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -865,7 +865,7 @@ static struct scst_dev_type vdisk_null_devtype = { "blocksize, " "dif_mode, " "dif_type, " - "dif_static_app_tag, ", + "dif_static_app_tag, " "dummy, " "numa_node_id, " "cluster_mode, " diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index be1edab25..ba163fc73 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -903,7 +903,7 @@ static ssize_t scst_tgtt_mgmt_show(struct kobject *kobj, "\n" "where parameters are one or more " "param_name=value pairs separated by ';'\n\n" - "%s%s%s%s%s%s%s%s\n"; + "%s%s%s%s%s%s%s%s%s%s\n"; struct scst_tgt_template *tgtt; tgtt = container_of(kobj, struct scst_tgt_template, tgtt_kobj); @@ -916,10 +916,12 @@ static ssize_t scst_tgtt_mgmt_show(struct kobject *kobj, " echo \"add_target_attribute target_name \" >mgmt\n" " echo \"del_target_attribute target_name \" >mgmt\n" : "", (tgtt->mgmt_cmd_help) ? tgtt->mgmt_cmd_help : "", + (tgtt->mgmt_cmd_help) ? "\n" : "", (tgtt->add_target_parameters != NULL) ? "The following parameters available: " : "", (tgtt->add_target_parameters != NULL) ? tgtt->add_target_parameters : "", + (tgtt->add_target_parameters != NULL) ? "\n" : "", (tgtt->tgtt_optional_attributes != NULL) ? "The following target driver attributes available: " : "", (tgtt->tgtt_optional_attributes != NULL) ? @@ -5935,7 +5937,7 @@ static ssize_t scst_devt_mgmt_show(struct kobject *kobj, "\n" "where parameters are one or more " "param_name=value pairs separated by ';'\n\n" - "%s%s%s%s%s%s%s%s\n"; + "%s%s%s%s%s%s%s%s%s%s\n"; struct scst_dev_type *devt; devt = container_of(kobj, struct scst_dev_type, devt_kobj); @@ -5945,13 +5947,15 @@ static ssize_t scst_devt_mgmt_show(struct kobject *kobj, " echo \"add_attribute \" >mgmt\n" " echo \"del_attribute \" >mgmt\n" : "", (devt->dev_optional_attributes != NULL) ? - " echo \"add_device_attribute device_name \" >mgmt" + " echo \"add_device_attribute device_name \" >mgmt\n" " echo \"del_device_attribute device_name \" >mgmt\n" : "", (devt->mgmt_cmd_help) ? devt->mgmt_cmd_help : "", + (devt->mgmt_cmd_help) ? "\n" : "", (devt->add_device_parameters != NULL) ? "The following parameters available: " : "", (devt->add_device_parameters != NULL) ? devt->add_device_parameters : "", + (devt->add_device_parameters != NULL) ? "\n" : "", (devt->devt_optional_attributes != NULL) ? "The following dev handler attributes available: " : "", (devt->devt_optional_attributes != NULL) ? @@ -6250,7 +6254,7 @@ int scst_devt_sysfs_create(struct scst_dev_type *devt) if (devt->add_device != NULL) { res = sysfs_create_file(&devt->devt_kobj, &scst_devt_mgmt.attr); - } else { + } else if (!devt->no_mgmt) { res = sysfs_create_file(&devt->devt_kobj, &scst_devt_pass_through_mgmt.attr); }