blk-mq: add REQ_SYNC early
authorShaohua Li <shli@kernel.org>
Wed, 19 Feb 2014 12:20:21 +0000 (20:20 +0800)
committerJens Axboe <axboe@fb.com>
Fri, 21 Mar 2014 14:57:58 +0000 (08:57 -0600)
Add REQ_SYNC early, so rq_dispatched[] in blk_mq_rq_ctx_init
is set correctly.

Signed-off-by: Shaohua Li<shli@fusionio.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c

index 3c28048..b1bcc61 100644 (file)
@@ -860,6 +860,8 @@ static void blk_mq_make_request(struct request_queue *q, struct bio *bio)
        ctx = blk_mq_get_ctx(q);
        hctx = q->mq_ops->map_queue(q, ctx->cpu);
 
+       if (is_sync)
+               rw |= REQ_SYNC;
        trace_block_getrq(q, bio, rw);
        rq = __blk_mq_alloc_request(hctx, GFP_ATOMIC, false);
        if (likely(rq))