mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
block: clean up misc stuff after block layer timeout conversion
* In blk_rq_timed_out_timer(), else { if } to else if * In blk_add_timer(), simplify if/else block [ Impact: cleanup ] Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
10732f5661
commit
2eef33e439
1 changed files with 9 additions and 13 deletions
|
@ -122,11 +122,9 @@ void blk_rq_timed_out_timer(unsigned long data)
|
||||||
if (blk_mark_rq_complete(rq))
|
if (blk_mark_rq_complete(rq))
|
||||||
continue;
|
continue;
|
||||||
blk_rq_timed_out(rq);
|
blk_rq_timed_out(rq);
|
||||||
} else {
|
} else if (!next || time_after(next, rq->deadline))
|
||||||
if (!next || time_after(next, rq->deadline))
|
|
||||||
next = rq->deadline;
|
next = rq->deadline;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* next can never be 0 here with the list non-empty, since we always
|
* next can never be 0 here with the list non-empty, since we always
|
||||||
|
@ -176,16 +174,14 @@ void blk_add_timer(struct request *req)
|
||||||
BUG_ON(!list_empty(&req->timeout_list));
|
BUG_ON(!list_empty(&req->timeout_list));
|
||||||
BUG_ON(test_bit(REQ_ATOM_COMPLETE, &req->atomic_flags));
|
BUG_ON(test_bit(REQ_ATOM_COMPLETE, &req->atomic_flags));
|
||||||
|
|
||||||
if (req->timeout)
|
|
||||||
req->deadline = jiffies + req->timeout;
|
|
||||||
else {
|
|
||||||
req->deadline = jiffies + q->rq_timeout;
|
|
||||||
/*
|
/*
|
||||||
* Some LLDs, like scsi, peek at the timeout to prevent
|
* Some LLDs, like scsi, peek at the timeout to prevent a
|
||||||
* a command from being retried forever.
|
* command from being retried forever.
|
||||||
*/
|
*/
|
||||||
|
if (!req->timeout)
|
||||||
req->timeout = q->rq_timeout;
|
req->timeout = q->rq_timeout;
|
||||||
}
|
|
||||||
|
req->deadline = jiffies + req->timeout;
|
||||||
list_add_tail(&req->timeout_list, &q->timeout_list);
|
list_add_tail(&req->timeout_list, &q->timeout_list);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue