2014-02-19 12:20:41

by Shaohua Li

[permalink] [raw]
Subject: [patch]blk-mq: add REQ_SYNC early


Add REQ_SYNC early, so rq_dispatched[] in blk_mq_rq_ctx_init is set correctly.

Signed-off-by: Shaohua Li<[email protected]>
---
block/blk-mq.c | 2 ++
1 file changed, 2 insertions(+)

Index: linux/block/blk-mq.c
===================================================================
--- linux.orig/block/blk-mq.c 2014-02-19 17:10:02.000000000 +0800
+++ linux/block/blk-mq.c 2014-02-19 18:51:25.082774359 +0800
@@ -926,6 +926,8 @@ static void blk_mq_make_request(struct r
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))