target: remove TF_TIMER_STOP
authorChristoph Hellwig <hch@infradead.org>
Mon, 17 Oct 2011 17:56:47 +0000 (13:56 -0400)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 24 Oct 2011 03:21:42 +0000 (03:21 +0000)
TF_TIMER_STOP is useless as it only helps to mitigate a tiny race during
deleting the timer.  But given that we have cleared TF_ACTIVE at this point
we already have another mitigation a few lines down the function.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c
include/target/target_core_base.h

index 6dab8198ace838a2edb7d431b1246188fd93eb3f..a36f4451e5db9d72c923096c6081912d431cf412 100644 (file)
@@ -2066,10 +2066,6 @@ static void transport_task_timeout_handler(unsigned long data)
        pr_debug("transport task timeout fired! task: %p cmd: %p\n", task, cmd);
 
        spin_lock_irqsave(&cmd->t_state_lock, flags);
-       if (task->task_flags & TF_TIMER_STOP) {
-               spin_unlock_irqrestore(&cmd->t_state_lock, flags);
-               return;
-       }
        task->task_flags &= ~TF_TIMER_RUNNING;
 
        /*
@@ -2153,14 +2149,12 @@ void __transport_stop_task_timer(struct se_task *task, unsigned long *flags)
        if (!(task->task_flags & TF_TIMER_RUNNING))
                return;
 
-       task->task_flags |= TF_TIMER_STOP;
        spin_unlock_irqrestore(&cmd->t_state_lock, *flags);
 
        del_timer_sync(&task->task_timer);
 
        spin_lock_irqsave(&cmd->t_state_lock, *flags);
        task->task_flags &= ~TF_TIMER_RUNNING;
-       task->task_flags &= ~TF_TIMER_STOP;
 }
 
 static void transport_stop_all_task_timers(struct se_cmd *cmd)
index 77b3de846340f8cc84f87252c3e0a0275ce4c23d..8f02a65de75f4967d279475974c574e6528cf7e2 100644 (file)
@@ -78,7 +78,6 @@ enum se_task_flags {
        TF_TIMEOUT              = (1 << 2),
        TF_REQUEST_STOP         = (1 << 3),
        TF_TIMER_RUNNING        = (1 << 4),
-       TF_TIMER_STOP           = (1 << 5),
 };
 
 /* Special transport agnostic struct se_cmd->t_states */