From: Keith Busch Date: Fri, 17 Oct 2014 23:46:38 +0000 (-0600) Subject: block: add blk-mq support to blk_insert_cloned_request() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7fb4898e0cd6e7eba7419790921391e53848a35d;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Mike Snitzer Signed-off-by: Jens Axboe --- 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) should_fail_request(&rq->rq_disk->part0, blk_rq_bytes(rq))) return -EIO; + if (q->mq_ops) { + if (blk_queue_io_stat(q)) + blk_account_io_start(rq, true); + blk_mq_insert_request(rq, false, true, true); + return 0; + } + spin_lock_irqsave(q->queue_lock, flags); if (unlikely(blk_queue_dying(q))) { spin_unlock_irqrestore(q->queue_lock, flags);