Commit c4a634f4 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: fold __blk_add_timer into blk_add_timer

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 38535201
...@@ -166,8 +166,15 @@ void blk_abort_request(struct request *req) ...@@ -166,8 +166,15 @@ void blk_abort_request(struct request *req)
} }
EXPORT_SYMBOL_GPL(blk_abort_request); EXPORT_SYMBOL_GPL(blk_abort_request);
static void __blk_add_timer(struct request *req, /**
struct list_head *timeout_list) * blk_add_timer - Start timeout timer for a single request
* @req: request that is about to start running.
*
* Notes:
* Each request has its own timer, and as it is added to the queue, we
* set up the timer. When the request completes, we cancel the timer.
*/
void blk_add_timer(struct request *req)
{ {
struct request_queue *q = req->q; struct request_queue *q = req->q;
unsigned long expiry; unsigned long expiry;
...@@ -185,8 +192,8 @@ static void __blk_add_timer(struct request *req, ...@@ -185,8 +192,8 @@ static void __blk_add_timer(struct request *req,
req->timeout = q->rq_timeout; req->timeout = q->rq_timeout;
req->deadline = jiffies + req->timeout; req->deadline = jiffies + req->timeout;
if (timeout_list) if (!q->mq_ops)
list_add_tail(&req->timeout_list, timeout_list); list_add_tail(&req->timeout_list, &req->q->timeout_list);
/* /*
* If the timer isn't already pending or this timeout is earlier * If the timer isn't already pending or this timeout is earlier
...@@ -211,22 +218,3 @@ static void __blk_add_timer(struct request *req, ...@@ -211,22 +218,3 @@ static void __blk_add_timer(struct request *req,
} }
} }
/**
* blk_add_timer - Start timeout timer for a single request
* @req: request that is about to start running.
*
* Notes:
* Each request has its own timer, and as it is added to the queue, we
* set up the timer. When the request completes, we cancel the timer.
*/
void blk_add_timer(struct request *req)
{
struct request_queue *q = req->q;
if (q->mq_ops)
__blk_add_timer(req, NULL);
else
__blk_add_timer(req, &req->q->timeout_list);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment