summaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorRoland Dreier2014-02-03 23:08:26 +0100
committerNicholas Bellinger2014-02-13 00:14:30 +0100
commit3dca1471993f9b89f3184468f8bbab2b1e024451 (patch)
tree52df51e9575fad725864d22cf30846c97e056dac /drivers/target
parentiser-target: Fix leak on failure in isert_conn_create_fastreg_pool (diff)
downloadkernel-qcow2-linux-3dca1471993f9b89f3184468f8bbab2b1e024451.tar.gz
kernel-qcow2-linux-3dca1471993f9b89f3184468f8bbab2b1e024451.tar.xz
kernel-qcow2-linux-3dca1471993f9b89f3184468f8bbab2b1e024451.zip
target: Simplify command completion by removing CMD_T_FAILED flag
The CMD_T_FAILED flag is set used in one place to record the result of a trivial test, and it is only tested once, few lines later. We might as well make the code simpler and easier to read by directly doing the test of "success" where we want to use it. Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_transport.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index c50fd9f11aab..24b4f65d8777 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -669,9 +669,6 @@ void target_complete_cmd(struct se_cmd *cmd, u8 scsi_status)
return;
}
- if (!success)
- cmd->transport_state |= CMD_T_FAILED;
-
/*
* Check for case where an explicit ABORT_TASK has been received
* and transport_wait_for_tasks() will be waiting for completion..
@@ -681,7 +678,7 @@ void target_complete_cmd(struct se_cmd *cmd, u8 scsi_status)
spin_unlock_irqrestore(&cmd->t_state_lock, flags);
complete(&cmd->t_transport_stop_comp);
return;
- } else if (cmd->transport_state & CMD_T_FAILED) {
+ } else if (!success) {
INIT_WORK(&cmd->work, target_complete_failure_work);
} else {
INIT_WORK(&cmd->work, target_complete_ok_work);