target: Merge transport_cmd_finish_abort_tmr into transport_cmd_finish_abort
authorNicholas Bellinger <nab@linux-iscsi.org>
Sun, 9 Oct 2011 09:02:51 +0000 (02:02 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 24 Oct 2011 03:20:58 +0000 (03:20 +0000)
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>
drivers/target/target_core_tmr.c
drivers/target/target_core_transport.c
include/target/target_core_transport.h

index efc5ec7da57c518a9ac63e9f2893b3991c4af561..b8dc10fd4ef7c40ce09dd7550e9b646ca08c60eb 100644 (file)
@@ -161,7 +161,7 @@ static void core_tmr_drain_tmr_list(
                        (preempt_and_abort_list) ? "Preempt" : "", tmr,
                        tmr->function, tmr->response, cmd->t_state);
 
-               transport_cmd_finish_abort_tmr(cmd);
+               transport_cmd_finish_abort(cmd, 1);
        }
 }
 
index f8de042e532ec45f8b18b40af40de7f9879dd04e..36fb39c2ce03dad817c39323c262482907ffadbe 100644 (file)
@@ -591,7 +591,8 @@ check_lun:
 
 void transport_cmd_finish_abort(struct se_cmd *cmd, int remove)
 {
-       transport_lun_remove_cmd(cmd);
+       if (!cmd->se_tmr_req)
+               transport_lun_remove_cmd(cmd);
 
        if (transport_cmd_check_stop_to_fabric(cmd))
                return;
@@ -601,16 +602,6 @@ void transport_cmd_finish_abort(struct se_cmd *cmd, int remove)
        }
 }
 
-void transport_cmd_finish_abort_tmr(struct se_cmd *cmd)
-{
-       transport_remove_cmd_from_queue(cmd, &cmd->se_dev->dev_queue_obj);
-
-       if (transport_cmd_check_stop_to_fabric(cmd))
-               return;
-
-       transport_put_cmd(cmd);
-}
-
 static void transport_add_cmd_to_queue(
        struct se_cmd *cmd,
        int t_state)
index 371c24aff23ef3f0c17de65c7eb3396e710545af..c91516910e3ec53530fb2fac1d3fd7c32869e404 100644 (file)
@@ -134,7 +134,6 @@ extern void transport_free_session(struct se_session *);
 extern void transport_deregister_session_configfs(struct se_session *);
 extern void transport_deregister_session(struct se_session *);
 extern void transport_cmd_finish_abort(struct se_cmd *, int);
-extern void transport_cmd_finish_abort_tmr(struct se_cmd *);
 extern void transport_complete_sync_cache(struct se_cmd *, int);
 extern void transport_complete_task(struct se_task *, int);
 extern void transport_add_task_to_execute_queue(struct se_task *,