diff options
author | Keith Busch <keith.busch@intel.com> | 2014-10-17 19:46:38 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-01-28 11:44:13 -0500 |
commit | 7fb4898e0cd6e7eba7419790921391e53848a35d (patch) | |
tree | f4f866edf02620a83f30d5340c336914a6918339 /block | |
parent | febf71588c2a750e04dc2a8b0824ce120c48bd9e (diff) |
block: add blk-mq support to blk_insert_cloned_request()
If the request passed to blk_insert_cloned_request() was allocated by
a blk-mq device it must be submitted using blk_mq_insert_request().
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 1b5fa214efa3..c81f02cd17d4 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -2048,6 +2048,13 @@ int blk_insert_cloned_request(struct request_queue *q, struct request *rq) | |||
2048 | should_fail_request(&rq->rq_disk->part0, blk_rq_bytes(rq))) | 2048 | should_fail_request(&rq->rq_disk->part0, blk_rq_bytes(rq))) |
2049 | return -EIO; | 2049 | return -EIO; |
2050 | 2050 | ||
2051 | if (q->mq_ops) { | ||
2052 | if (blk_queue_io_stat(q)) | ||
2053 | blk_account_io_start(rq, true); | ||
2054 | blk_mq_insert_request(rq, false, true, true); | ||
2055 | return 0; | ||
2056 | } | ||
2057 | |||
2051 | spin_lock_irqsave(q->queue_lock, flags); | 2058 | spin_lock_irqsave(q->queue_lock, flags); |
2052 | if (unlikely(blk_queue_dying(q))) { | 2059 | if (unlikely(blk_queue_dying(q))) { |
2053 | spin_unlock_irqrestore(q->queue_lock, flags); | 2060 | spin_unlock_irqrestore(q->queue_lock, flags); |