diff options
author | Roland Dreier <roland@purestorage.com> | 2012-11-16 17:06:19 +0100 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-11-28 07:49:18 +0100 |
commit | c18bc7d8d34103d4bae47db180b508413f98dc36 (patch) | |
tree | f3c8e79c10e502908df0cbc4eb2f607ed5636a0d /drivers/target | |
parent | target: Clean up logic in transport_put_cmd() (diff) | |
download | linux-c18bc7d8d34103d4bae47db180b508413f98dc36.tar.xz linux-c18bc7d8d34103d4bae47db180b508413f98dc36.zip |
target: Clean up flow in transport_check_aborted_status()
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_transport.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 7e7fa58b56ea..1ebde4c56847 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -2761,23 +2761,19 @@ EXPORT_SYMBOL(transport_send_check_condition_and_sense); int transport_check_aborted_status(struct se_cmd *cmd, int send_status) { - int ret = 0; + if (!(cmd->transport_state & CMD_T_ABORTED)) + return 0; - if (cmd->transport_state & CMD_T_ABORTED) { - if (!send_status || - (cmd->se_cmd_flags & SCF_SENT_DELAYED_TAS)) - return 1; + if (!send_status || (cmd->se_cmd_flags & SCF_SENT_DELAYED_TAS)) + return 1; - pr_debug("Sending delayed SAM_STAT_TASK_ABORTED" - " status for CDB: 0x%02x ITT: 0x%08x\n", - cmd->t_task_cdb[0], - cmd->se_tfo->get_task_tag(cmd)); + pr_debug("Sending delayed SAM_STAT_TASK_ABORTED status for CDB: 0x%02x ITT: 0x%08x\n", + cmd->t_task_cdb[0], cmd->se_tfo->get_task_tag(cmd)); - cmd->se_cmd_flags |= SCF_SENT_DELAYED_TAS; - cmd->se_tfo->queue_status(cmd); - ret = 1; - } - return ret; + cmd->se_cmd_flags |= SCF_SENT_DELAYED_TAS; + cmd->se_tfo->queue_status(cmd); + + return 1; } EXPORT_SYMBOL(transport_check_aborted_status); |