scst: minor forwarding mode fixes

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7077 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2016-12-20 06:28:41 +00:00
parent 283b30f603
commit 5e73767a1b
3 changed files with 9 additions and 11 deletions
+2 -3
View File
@@ -1285,8 +1285,7 @@ static const struct scst_sdbops scst_scsi_op_table[] = {
{.ops = 0x84, .devkey = "O ", /* implemented only for disks */
.info_op_name = "RECEIVE COPY RESULT",
.info_data_direction = SCST_DATA_READ,
.info_op_flags = SCST_FULLY_LOCAL_CMD|SCST_LOCAL_CMD|
SCST_WRITE_EXCL_ALLOWED|SCST_EXCL_ACCESS_ALLOWED,
.info_op_flags = SCST_LOCAL_CMD|SCST_WRITE_EXCL_ALLOWED|SCST_EXCL_ACCESS_ALLOWED,
.info_len_off = 10, .info_len_len = 4,
.get_cdb_info = get_cdb_info_len_4},
{.ops = 0x85, .devkey = "O O O ",
@@ -1322,7 +1321,7 @@ static const struct scst_sdbops scst_scsi_op_table[] = {
.info_op_name = "COMPARE AND WRITE",
.info_data_direction = SCST_DATA_WRITE,
.info_op_flags = SCST_TRANSFER_LEN_TYPE_FIXED|
SCST_FULLY_LOCAL_CMD|SCST_LOCAL_CMD|
SCST_LOCAL_CMD|
SCST_WRITE_MEDIUM|SCST_SCSI_ATOMIC,
.info_lba_off = 2, .info_lba_len = 8,
.info_len_off = 13, .info_len_len = 1,
+4 -6
View File
@@ -3077,8 +3077,6 @@ static ssize_t scst_dev_sysfs_pr_file_name_show(struct kobject *kobj,
res = mutex_lock_interruptible(&dev->dev_pr_mutex);
if (res != 0)
goto out;
/* pr_file_name is NULL for SCSI pass-through devices */
WARN_ON_ONCE(!dev->pr_file_name);
res = scnprintf(buf, PAGE_SIZE, "%s\n%s", dev->pr_file_name ? : "",
dev->pr_file_name_is_set ? SCST_SYSFS_KEY_MARK "\n" :
"");
@@ -3900,7 +3898,9 @@ int scst_dev_sysfs_create(struct scst_device *dev)
dev->virt_name);
goto out_del;
}
} else {
}
if (dev->pr_file_name != NULL) {
res = sysfs_create_file(&dev->dev_kobj,
&dev_pr_file_name_attr.attr);
if (res != 0) {
@@ -3909,10 +3909,8 @@ int scst_dev_sysfs_create(struct scst_device *dev)
dev->virt_name);
goto out_del;
}
}
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
if (dev->scsi_dev == NULL) {
res = sysfs_create_file(&dev->dev_kobj,
&dev_dump_prs_attr.attr);
if (res != 0) {
@@ -3920,8 +3918,8 @@ int scst_dev_sysfs_create(struct scst_device *dev)
dev_dump_prs_attr.attr.name, dev->virt_name);
goto out_del;
}
}
#endif
}
out:
TRACE_EXIT_RES(res);
+3 -2
View File
@@ -3221,8 +3221,7 @@ int __scst_check_local_events(struct scst_cmd *cmd, bool preempt_tests_only)
* All the checks are supposed to be done on the
* forwarding requester's side.
*/
res = 0;
goto out;
goto skip_reserve;
}
/*
@@ -3255,6 +3254,7 @@ int __scst_check_local_events(struct scst_cmd *cmd, bool preempt_tests_only)
* Let's check for ABORTED after scst_pr_is_cmd_allowed(), because
* we might sleep for a while there.
*/
skip_reserve:
if (unlikely(test_bit(SCST_CMD_ABORTED, &cmd->cmd_flags))) {
TRACE_MGMT_DBG("ABORTED set, aborting cmd %p", cmd);
goto out_uncomplete;
@@ -3762,6 +3762,7 @@ done:
break;
EXTRACHECKS_BUG_ON(cmd->state != SCST_CMD_STATE_EXEC_CHECK_SN);
EXTRACHECKS_BUG_ON(cmd->done);
cmd->state = SCST_CMD_STATE_EXEC_CHECK_BLOCKING;