Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196812
b: refs/heads/master
c: c0d97e9
h: refs/heads/master
v: v3
  • Loading branch information
Richard Kennedy authored and Jens Axboe committed Apr 14, 2010
1 parent adfb379 commit 82f4dff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 28baf44299e0480d66ebb3093de5d51deff04e9f
refs/heads/master: c0d97e9ca2cfa66bdfd1ed8ecb5dcd230924d675
12 changes: 5 additions & 7 deletions trunk/block/blk-timeout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
Expand Down

0 comments on commit 82f4dff

Please sign in to comment.