Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118509
b: refs/heads/master
c: 7838c15
h: refs/heads/master
i:
  118507: c279405
v: v3
  • Loading branch information
Alan Stern authored and Jens Axboe committed Nov 6, 2008
1 parent deb2c72 commit a69d55d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 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: 9c133c469d38043d5aadaa03f2fb840d88d1cf4f
refs/heads/master: 7838c15b8dd18e78a523513749e5b54bda07b0cb
20 changes: 3 additions & 17 deletions trunk/block/blk-timeout.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,7 @@ void blk_delete_timer(struct request *req)
{
struct request_queue *q = req->q;

/*
* Nothing to detach
*/
if (!q->rq_timed_out_fn || !req->deadline)
return;

list_del_init(&req->timeout_list);

if (list_empty(&q->timeout_list))
del_timer(&q->timeout);
}
Expand Down Expand Up @@ -142,7 +135,7 @@ void blk_rq_timed_out_timer(unsigned long data)
}

if (next_set && !list_empty(&q->timeout_list))
mod_timer(&q->timeout, round_jiffies(next));
mod_timer(&q->timeout, round_jiffies_up(next));

spin_unlock_irqrestore(q->queue_lock, flags);
}
Expand Down Expand Up @@ -198,17 +191,10 @@ void blk_add_timer(struct request *req)

/*
* If the timer isn't already pending or this timeout is earlier
* than an existing one, modify the timer. Round to next nearest
* than an existing one, modify the timer. Round up to next nearest
* second.
*/
expiry = round_jiffies(req->deadline);

/*
* We use ->deadline == 0 to detect whether a timer was added or
* not, so just increase to next jiffy for that specific case
*/
if (unlikely(!req->deadline))
req->deadline = 1;
expiry = round_jiffies_up(req->deadline);

if (!timer_pending(&q->timeout) ||
time_before(expiry, q->timeout.expires))
Expand Down

0 comments on commit a69d55d

Please sign in to comment.