]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - block/blk-timeout.c
Merge branch 'fix/hda' into topic/hda
[linux-2.6-omap-h63xx.git] / block / blk-timeout.c
index 116bbf394fb53d7a5ed8499af6fd59e76d31e94b..a09535377a94c0b84a59118533f5e4ddeaa1076d 100644 (file)
@@ -73,11 +73,7 @@ ssize_t part_timeout_store(struct device *dev, struct device_attribute *attr,
  */
 void blk_delete_timer(struct request *req)
 {
-       struct request_queue *q = req->q;
-
        list_del_init(&req->timeout_list);
-       if (list_empty(&q->timeout_list))
-               del_timer(&q->timeout);
 }
 
 static void blk_rq_timed_out(struct request *req)
@@ -132,7 +128,12 @@ void blk_rq_timed_out_timer(unsigned long data)
                }
        }
 
-       if (next_set && !list_empty(&q->timeout_list))
+       /*
+        * next can never be 0 here with the list non-empty, since we always
+        * bump ->deadline to 1 so we can detect if the timer was ever added
+        * or not. See comment in blk_add_timer()
+        */
+       if (next)
                mod_timer(&q->timeout, round_jiffies_up(next));
 
        spin_unlock_irqrestore(q->queue_lock, flags);