summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-05-29 15:52:39 +0200
committerJens Axboe <axboe@kernel.dk>2018-05-29 08:59:21 -0600
commitd1210d5afb9e16527f0b18448d82c675c03aa7c0 (patch)
tree9100cc6a062b116dc3a813ba6e72368a4cd8dfbe
parent88b0cfad288831a86ffd79b6d00b689489598186 (diff)
downloadlinux-stable-d1210d5afb9e16527f0b18448d82c675c03aa7c0.tar.gz
linux-stable-d1210d5afb9e16527f0b18448d82c675c03aa7c0.tar.bz2
linux-stable-d1210d5afb9e16527f0b18448d82c675c03aa7c0.zip
blk-mq: simplify blk_mq_rq_timed_out
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/blk-mq.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 51edbbb91369..3d3952301b3e 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -770,22 +770,16 @@ EXPORT_SYMBOL(blk_mq_tag_to_rq);
static void blk_mq_rq_timed_out(struct request *req, bool reserved)
{
- const struct blk_mq_ops *ops = req->q->mq_ops;
- enum blk_eh_timer_return ret = BLK_EH_RESET_TIMER;
+ if (req->q->mq_ops->timeout) {
+ enum blk_eh_timer_return ret;
- if (ops->timeout)
- ret = ops->timeout(req, reserved);
-
- switch (ret) {
- case BLK_EH_RESET_TIMER:
- blk_add_timer(req);
- break;
- case BLK_EH_DONE:
- break;
- default:
- printk(KERN_ERR "block: bad eh return: %d\n", ret);
- break;
+ ret = req->q->mq_ops->timeout(req, reserved);
+ if (ret == BLK_EH_DONE)
+ return;
+ WARN_ON_ONCE(ret != BLK_EH_RESET_TIMER);
}
+
+ blk_add_timer(req);
}
static bool blk_mq_req_expired(struct request *rq, unsigned long *next)