Skip to content

Commit

Permalink
block: clean up misc stuff after block layer timeout conversion
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
htejun authored and Jens Axboe committed Apr 28, 2009
1 parent 10732f5 commit 2eef33e
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions block/blk-timeout.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,8 @@ 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))
next = rq->deadline;
}
} else if (!next || time_after(next, rq->deadline))
next = rq->deadline;
}

/*
Expand Down Expand Up @@ -176,16 +174,14 @@ void blk_add_timer(struct request *req)
BUG_ON(!list_empty(&req->timeout_list));
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
* a command from being retried forever.
*/
/*
* Some LLDs, like scsi, peek at the timeout to prevent a
* command from being retried forever.
*/
if (!req->timeout)
req->timeout = q->rq_timeout;
}

req->deadline = jiffies + req->timeout;
list_add_tail(&req->timeout_list, &q->timeout_list);

/*
Expand Down

0 comments on commit 2eef33e

Please sign in to comment.