mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 13:46:25 +00:00
scst: fix displaying "mgmt" sysfs help information
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7327 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -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).
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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, "
|
||||
|
||||
@@ -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 <attribute> <value>\" >mgmt\n"
|
||||
" echo \"del_target_attribute target_name <attribute> <value>\" >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 <attribute> <value>\" >mgmt\n"
|
||||
" echo \"del_attribute <attribute> <value>\" >mgmt\n" : "",
|
||||
(devt->dev_optional_attributes != NULL) ?
|
||||
" echo \"add_device_attribute device_name <attribute> <value>\" >mgmt"
|
||||
" echo \"add_device_attribute device_name <attribute> <value>\" >mgmt\n"
|
||||
" echo \"del_device_attribute device_name <attribute> <value>\" >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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user