Merge branch 'svn-trunk'

This commit is contained in:
Bart Van Assche
2018-01-04 21:34:09 -08:00
5 changed files with 25 additions and 6 deletions

View File

@@ -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).

View File

@@ -399,4 +399,13 @@ do { \
#define SCST_SLAB_FLAGS 0L
#endif
#define PRINT_WARNING_ONCE(format, args...) \
do { \
static bool __warned; \
if (!__warned) { \
__warned = true; \
PRINT_WARNING(format, ## args); \
} \
} while(0)
#endif /* __SCST_DEBUG_H */

View File

@@ -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,

View File

@@ -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, "
@@ -3847,7 +3847,7 @@ static int vdisk_unmap_file_range(struct scst_cmd *cmd,
res = fd->f_op->fallocate(fd,
FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, off, len);
if (unlikely(res != 0)) {
PRINT_ERROR("fallocate() for %lld, len %lld "
PRINT_WARNING_ONCE("fallocate() for %lld, len %lld "
"failed: %d", (unsigned long long)off,
(unsigned long long)len, res);
scst_set_cmd_error(cmd,

View File

@@ -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) ?
@@ -5917,7 +5919,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);
@@ -5927,13 +5929,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) ?
@@ -6232,7 +6236,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);
}