X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=block%2Fblk-timeout.c;h=4f0c06c7a3388062f5aa58a8ffbe56de5d7c1f1e;hb=4de85cd6d6018825e19f76f1208775f23ecc393f;hp=1ba7e0aca8781b55ce14fa54491da8f81505b747;hpb=2eef33e439ba9ae387cdc3f1abcef2f3f6c4e7a8;p=safe%2Fjmp%2Flinux-2.6 diff --git a/block/blk-timeout.c b/block/blk-timeout.c index 1ba7e0a..4f0c06c 100644 --- a/block/blk-timeout.c +++ b/block/blk-timeout.c @@ -109,6 +109,7 @@ void blk_rq_timed_out_timer(unsigned long data) struct request_queue *q = (struct request_queue *) data; unsigned long flags, next = 0; struct request *rq, *tmp; + int next_set = 0; spin_lock_irqsave(q->queue_lock, flags); @@ -122,16 +123,13 @@ void blk_rq_timed_out_timer(unsigned long data) if (blk_mark_rq_complete(rq)) continue; blk_rq_timed_out(rq); - } else if (!next || time_after(next, rq->deadline)) + } else if (!next_set || time_after(next, rq->deadline)) { next = rq->deadline; + next_set = 1; + } } - /* - * 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) + if (next_set) mod_timer(&q->timeout, round_jiffies_up(next)); spin_unlock_irqrestore(q->queue_lock, flags);