block: fix blk_abort_request on blk-mq
authorChristoph Hellwig <hch@lst.de>
Mon, 22 Sep 2014 16:21:48 +0000 (10:21 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 22 Sep 2014 18:00:08 +0000 (12:00 -0600)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Moved blk_mq_rq_timed_out() definition to the private blk-mq.h header.

Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c
block/blk-mq.h
block/blk-timeout.c

index c5345a95182035901820553d6606c49dc3a388f1..a3a80884ed95285996277d4fdfc9d3935947ac86 100644 (file)
@@ -530,7 +530,7 @@ struct blk_mq_timeout_data {
        unsigned int next_set;
 };
 
-static void blk_mq_rq_timed_out(struct request *req, bool reserved)
+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;
index ca4964a6295d48490f22e25f513c39165af190a4..a3c613a9df2da89c92c03d4298d3be7796d28c57 100644 (file)
@@ -60,6 +60,8 @@ extern int blk_mq_hw_queue_to_node(unsigned int *map, unsigned int);
 extern int blk_mq_sysfs_register(struct request_queue *q);
 extern void blk_mq_sysfs_unregister(struct request_queue *q);
 
+extern void blk_mq_rq_timed_out(struct request *req, bool reserved);
+
 /*
  * Basic implementation of sparser bitmap, allowing the user to spread
  * the bits over more cachelines.
index 8bae410b8a1b678183cd986d58cfbc8765bfd96f..56c025894cdf2d73f78c5346c9c5987d5deb0e37 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/fault-inject.h>
 
 #include "blk.h"
+#include "blk-mq.h"
 
 #ifdef CONFIG_FAIL_IO_TIMEOUT
 
@@ -158,7 +159,10 @@ void blk_abort_request(struct request *req)
        if (blk_mark_rq_complete(req))
                return;
        blk_delete_timer(req);
-       blk_rq_timed_out(req);
+       if (req->q->mq_ops)
+               blk_mq_rq_timed_out(req, false);
+       else
+               blk_rq_timed_out(req);
 }
 EXPORT_SYMBOL_GPL(blk_abort_request);