Merge branch 'svn-trunk' (r6198)

Conflicts:
	scst/src/dev_handlers/scst_disk.c
	scst/src/scst_lib.c
This commit is contained in:
Bart Van Assche
2015-05-02 07:40:23 +02:00
7 changed files with 19 additions and 25 deletions

View File

@@ -6588,8 +6588,7 @@ static ssize_t q2t_show_expl_conf_enabled(struct kobject *kobj,
res = scnprintf(buffer, PAGE_SIZE, "%d\n%s",
vha->hw->enable_explicit_conf,
vha->hw->enable_explicit_conf ?
SCST_SYSFS_KEY_MARK "\n" : "");
vha->hw->enable_explicit_conf ? SCST_SYSFS_KEY_MARK "\n" : "");
out:
return res;

View File

@@ -3972,10 +3972,9 @@ void qla2x00_relogin(struct scsi_qla_host *vha)
if (fcport->flags &
FCF_FCP2_DEVICE)
opts |= BIT_1;
status2 =
qla2x00_get_port_database(
vha, fcport,
opts);
status2 =
qla2x00_get_port_database(
vha, fcport, opts);
if (status2 != QLA_SUCCESS)
status = 1;
}

View File

@@ -3963,6 +3963,12 @@ static inline bool scst_cmd_atomic(struct scst_cmd *cmd)
return res;
}
/* Returns TRUE if cmd completed with SAM_STAT_GOOD */
static inline bool scst_cmd_completed_good(struct scst_cmd *cmd)
{
return cmd->completed && (cmd->status == SAM_STAT_GOOD);
}
/*
* Returns TRUE if cmd has been preliminary completed, i.e. completed or
* aborted.

View File

@@ -499,8 +499,7 @@ split:
rc = scst_scsi_exec_async(cmd, &work, disk_cmd_done);
if (unlikely(rc != 0)) {
PRINT_ERROR("scst_scsi_exec_async() failed: %d",
rc);
PRINT_ERROR("scst_scsi_exec_async() failed: %d", rc);
goto out_err_restore;
}

View File

@@ -9473,8 +9473,7 @@ static ssize_t vdev_dif_filename_show(struct kobject *kobj,
virt_dev = dev->dh_priv;
pos = sprintf(buf, "%s\n%s", virt_dev->dif_filename,
(virt_dev->dif_filename != NULL) ?
SCST_SYSFS_KEY_MARK "\n" : "");
(virt_dev->dif_filename != NULL) ? SCST_SYSFS_KEY_MARK "\n" : "");
TRACE_EXIT_RES(pos);
return pos;

View File

@@ -10966,19 +10966,15 @@ int scst_block_generic_dev_done(struct scst_cmd *cmd,
void (*set_block_shift)(struct scst_cmd *cmd, int block_shift))
{
int opcode = cmd->cdb[0];
int status = cmd->status;
int res = SCST_CMD_STATE_DEFAULT;
int sect_sz_off;
TRACE_ENTRY();
/* Do not call this function for aborted commands. */
WARN_ON_ONCE(!cmd->completed);
if (unlikely(opcode == READ_CAPACITY ||
(opcode == SERVICE_ACTION_IN_16 &&
cmd->cdb[1] == SAI_READ_CAPACITY_16))) {
if ((status == SAM_STAT_GOOD) || (status == SAM_STAT_CONDITION_MET)) {
if (scst_cmd_completed_good(cmd)) {
/* Always keep track of disk capacity */
int buffer_size, sector_size, sh;
uint8_t *buffer;
@@ -11032,10 +11028,7 @@ int scst_tape_generic_dev_done(struct scst_cmd *cmd,
TRACE_ENTRY();
/* Do not call this function for aborted commands. */
WARN_ON_ONCE(!cmd->completed);
if (unlikely(cmd->status != SAM_STAT_GOOD))
if (unlikely(!scst_cmd_completed_good(cmd)))
goto out;
switch (opcode) {

View File

@@ -3591,7 +3591,7 @@ next:
goto out;
}
if (likely(cmd->status == SAM_STAT_GOOD)) {
if (likely(scst_cmd_completed_good(cmd))) {
if (cmd->deferred_dif_read_check) {
int rc = scst_dif_process_read(cmd);
if (unlikely(rc != 0)) {
@@ -3791,9 +3791,8 @@ static int scst_dev_done(struct scst_cmd *cmd)
state = SCST_CMD_STATE_PRE_XMIT_RESP1;
if (likely(cmd->completed &&
!(cmd->op_flags & SCST_FULLY_LOCAL_CMD) &&
devt->dev_done)) {
if (likely((cmd->op_flags & SCST_FULLY_LOCAL_CMD) == 0) &&
likely(devt->dev_done != NULL)) {
int rc;
if (unlikely(!devt->dev_done_atomic &&
@@ -4463,8 +4462,8 @@ static int scst_translate_lun(struct scst_cmd *cmd)
scst_put(cmd->cpu_cmd_counter);
}
} else {
TRACE_MGMT_DBG("%s", "FLAG SUSPENDED set, skipping");
scst_put(cmd->cpu_cmd_counter);
TRACE_MGMT_DBG("%s", "FLAG SUSPENDED set, skipping");
res = 1;
}
@@ -5061,8 +5060,8 @@ static int scst_get_mgmt(struct scst_mgmt_cmd *mcmd)
if (unlikely(test_bit(SCST_FLAG_SUSPENDED, &scst_flags) &&
!test_bit(SCST_FLAG_SUSPENDING, &scst_flags))) {
TRACE_MGMT_DBG("%s", "FLAG SUSPENDED set, skipping");
scst_put(mcmd->cpu_cmd_counter);
TRACE_MGMT_DBG("%s", "FLAG SUSPENDED set, skipping");
res = 1;
goto out;
}