aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2011-10-09 05:02:51 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-10-23 23:20:58 -0400
commit8dc52b54207f361f7abf6cbe26f5199ae8b7cf23 (patch)
tree71b328bf052940a44af314b1524a2a7a3765337e /drivers
parentd270190a75e5b859c6d8eed8d4095fbb45f78264 (diff)
target: Merge transport_cmd_finish_abort_tmr into transport_cmd_finish_abort
This patch merges transport_cmd_finish_abort_tmr() logic into a single transport_cmd_finish_abort() function by adding a cmd->se_tmr_req check around transport_lun_remove_cmd(), and updates the single caller within core_tmr_drain_tmr_list(). Reported-by: Christoph Hellwig <hch@lst.de> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/target/target_core_tmr.c2
-rw-r--r--drivers/target/target_core_transport.c13
2 files changed, 3 insertions, 12 deletions
diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c
index efc5ec7da57c..b8dc10fd4ef7 100644
--- a/drivers/target/target_core_tmr.c
+++ b/drivers/target/target_core_tmr.c
@@ -161,7 +161,7 @@ static void core_tmr_drain_tmr_list(
161 (preempt_and_abort_list) ? "Preempt" : "", tmr, 161 (preempt_and_abort_list) ? "Preempt" : "", tmr,
162 tmr->function, tmr->response, cmd->t_state); 162 tmr->function, tmr->response, cmd->t_state);
163 163
164 transport_cmd_finish_abort_tmr(cmd); 164 transport_cmd_finish_abort(cmd, 1);
165 } 165 }
166} 166}
167 167
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index f8de042e532e..36fb39c2ce03 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -591,7 +591,8 @@ check_lun:
591 591
592void transport_cmd_finish_abort(struct se_cmd *cmd, int remove) 592void transport_cmd_finish_abort(struct se_cmd *cmd, int remove)
593{ 593{
594 transport_lun_remove_cmd(cmd); 594 if (!cmd->se_tmr_req)
595 transport_lun_remove_cmd(cmd);
595 596
596 if (transport_cmd_check_stop_to_fabric(cmd)) 597 if (transport_cmd_check_stop_to_fabric(cmd))
597 return; 598 return;
@@ -601,16 +602,6 @@ void transport_cmd_finish_abort(struct se_cmd *cmd, int remove)
601 } 602 }
602} 603}
603 604
604void transport_cmd_finish_abort_tmr(struct se_cmd *cmd)
605{
606 transport_remove_cmd_from_queue(cmd, &cmd->se_dev->dev_queue_obj);
607
608 if (transport_cmd_check_stop_to_fabric(cmd))
609 return;
610
611 transport_put_cmd(cmd);
612}
613
614static void transport_add_cmd_to_queue( 605static void transport_add_cmd_to_queue(
615 struct se_cmd *cmd, 606 struct se_cmd *cmd,
616 int t_state) 607 int t_state)