提交 c22d9d8a 编写于 作者: J Jens Axboe

blk-mq: allow setting of per-request timeouts

Currently blk-mq uses the queue timeout for all requests. But
for some commands, drivers may want to set a specific timeout
for special requests. Allow this to be passed in through
request->timeout, and use it if set.
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 edf866b3
......@@ -454,9 +454,13 @@ static void blk_mq_start_request(struct request *rq, bool last)
/*
* Just mark start time and set the started bit. Due to memory
* ordering, we know we'll see the correct deadline as long as
* REQ_ATOMIC_STARTED is seen.
* REQ_ATOMIC_STARTED is seen. Use the default queue timeout,
* unless one has been set in the request.
*/
if (!rq->timeout)
rq->deadline = jiffies + q->rq_timeout;
else
rq->deadline = jiffies + rq->timeout;
/*
* Mark us as started and clear complete. Complete might have been
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册