aboutsummaryrefslogtreecommitdiff
path: root/drivers/target/target_core_tmr.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-10-12 11:07:03 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-10-24 03:21:06 +0000
commit6c76bf951cb099f5573954b1f56c1121c3a41c72 (patch)
treee9b739b4fb28ae7e2be2fdf400dc4772d63360b8 /drivers/target/target_core_tmr.c
parent42bf829eee0e36371a3df43978b14572c716cbe7 (diff)
target: make more use of the task_flags field in se_task
Replace various atomic_t variables that were mostly under t_state_lock with new flags in task_flags. Note that the execution error path didn't take t_state_lock before, so add it there. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_tmr.c')
-rw-r--r--drivers/target/target_core_tmr.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c
index b8dc10fd4ef..b5c18648fa2 100644
--- a/drivers/target/target_core_tmr.c
+++ b/drivers/target/target_core_tmr.c
@@ -259,8 +259,8 @@ static void core_tmr_drain_task_list(
atomic_read(&cmd->t_transport_stop),
atomic_read(&cmd->t_transport_sent));
- if (atomic_read(&task->task_active)) {
- atomic_set(&task->task_stop, 1);
+ if (task->task_flags & TF_ACTIVE) {
+ task->task_flags |= TF_REQUEST_STOP;
spin_unlock_irqrestore(
&cmd->t_state_lock, flags);
@@ -269,11 +269,10 @@ static void core_tmr_drain_task_list(
wait_for_completion(&task->task_stop_comp);
pr_debug("LUN_RESET Completed task: %p shutdown for"
" dev: %p\n", task, dev);
+
spin_lock_irqsave(&cmd->t_state_lock, flags);
atomic_dec(&cmd->t_task_cdbs_left);
-
- atomic_set(&task->task_active, 0);
- atomic_set(&task->task_stop, 0);
+ task->task_flags &= ~(TF_ACTIVE | TF_REQUEST_STOP);
}
__transport_stop_task_timer(task, &flags);