lkml.org 
[lkml]   [2009]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 05/14] block: clean up misc stuff after block layer timeout conversion
    Date
    * 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>
    ---
    block/blk-timeout.c | 22 +++++++++-------------
    1 files changed, 9 insertions(+), 13 deletions(-)

    diff --git a/block/blk-timeout.c b/block/blk-timeout.c
    index 8f570c4..590d1eb 100644
    --- a/block/blk-timeout.c
    +++ b/block/blk-timeout.c
    @@ -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;
    }

    /*
    @@ -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);

    /*
    --
    1.6.0.2


    \
     
     \ /
      Last update: 2009-04-21 18:43    [W:0.020 / U:0.268 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site