blk-mq: pass a reserved argument to the timeout handler

Allow blk-mq to pass an argument to the timeout handler to indicate
if we're timing out a reserved or regular command.  For many drivers
those need to be handled different.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Christoph Hellwig
2014-09-13 16:40:13 -07:00
committed by Jens Axboe
parent 46f92d42ee
commit 0152fb6b57
3 changed files with 14 additions and 5 deletions

View File

@@ -530,7 +530,7 @@ struct blk_mq_timeout_data {
unsigned int next_set;
};
static void blk_mq_rq_timed_out(struct request *req)
static void blk_mq_rq_timed_out(struct request *req, bool reserved)
{
struct blk_mq_ops *ops = req->q->mq_ops;
enum blk_eh_timer_return ret = BLK_EH_RESET_TIMER;
@@ -548,7 +548,7 @@ static void blk_mq_rq_timed_out(struct request *req)
return;
if (ops->timeout)
ret = ops->timeout(req);
ret = ops->timeout(req, reserved);
switch (ret) {
case BLK_EH_HANDLED:
@@ -576,7 +576,7 @@ static void blk_mq_check_expired(struct blk_mq_hw_ctx *hctx,
if (time_after_eq(jiffies, rq->deadline)) {
if (!blk_mark_rq_complete(rq))
blk_mq_rq_timed_out(rq);
blk_mq_rq_timed_out(rq, reserved);
} else if (!data->next_set || time_after(data->next, rq->deadline)) {
data->next = rq->deadline;
data->next_set = 1;