diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-08-10 01:53:02 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-08-22 15:26:23 -0400 |
commit | 72f4ba1e32a1e5da31dcf14ea4b8985ae88a8bdb (patch) | |
tree | fdef968c60122a837d22282aef136cda1b6f84ed | |
parent | 12850626e2717f866a94e6ced724e3efe5a0aab8 (diff) |
target: Remove duplicate task completions in transport_emulate_control_cdb
This patch removes a duplicate set of transport_complete_task() calls in
target_emulate_unmap() and target_emulate_write_same() as the completion
call is already done within transport_emulate_control_cdb()
This patch also adds a check in transport_emulate_control_cdb() for the
existing SCF_EMULATE_CDB_ASYNC flag currently used by SYNCHRONIZE_CACHE
in order to handle IMMEDIATE processing.
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/target/target_core_cdb.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c index 4c1d3a98e894..40ad142f7cb3 100644 --- a/drivers/target/target_core_cdb.c +++ b/drivers/target/target_core_cdb.c | |||
@@ -1077,8 +1077,6 @@ target_emulate_unmap(struct se_task *task) | |||
1077 | size -= 16; | 1077 | size -= 16; |
1078 | } | 1078 | } |
1079 | 1079 | ||
1080 | task->task_scsi_status = GOOD; | ||
1081 | transport_complete_task(task, 1); | ||
1082 | err: | 1080 | err: |
1083 | transport_kunmap_first_data_page(cmd); | 1081 | transport_kunmap_first_data_page(cmd); |
1084 | 1082 | ||
@@ -1115,8 +1113,6 @@ target_emulate_write_same(struct se_task *task, u32 num_blocks) | |||
1115 | return ret; | 1113 | return ret; |
1116 | } | 1114 | } |
1117 | 1115 | ||
1118 | task->task_scsi_status = GOOD; | ||
1119 | transport_complete_task(task, 1); | ||
1120 | return 0; | 1116 | return 0; |
1121 | } | 1117 | } |
1122 | 1118 | ||
@@ -1228,8 +1224,14 @@ transport_emulate_control_cdb(struct se_task *task) | |||
1228 | 1224 | ||
1229 | if (ret < 0) | 1225 | if (ret < 0) |
1230 | return ret; | 1226 | return ret; |
1231 | task->task_scsi_status = GOOD; | 1227 | /* |
1232 | transport_complete_task(task, 1); | 1228 | * Handle the successful completion here unless a caller |
1229 | * has explictly requested an asychronous completion. | ||
1230 | */ | ||
1231 | if (!(cmd->se_cmd_flags & SCF_EMULATE_CDB_ASYNC)) { | ||
1232 | task->task_scsi_status = GOOD; | ||
1233 | transport_complete_task(task, 1); | ||
1234 | } | ||
1233 | 1235 | ||
1234 | return PYX_TRANSPORT_SENT_TO_TRANSPORT; | 1236 | return PYX_TRANSPORT_SENT_TO_TRANSPORT; |
1235 | } | 1237 | } |