summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Bjørling <mb@silverwolf.dk>2012-07-13 10:29:12 -0600
committerJens Axboe <axboe@kernel.dk>2012-10-04 11:04:35 +0200
commit0d4e53aac982d1ca56570830cdf908377a6c9493 (patch)
tree6d8c67338679dd4c614618510f8cb756383828c1
parent2af6caf2285663ddf73104584f2f8068b7c3e0fa (diff)
multiqueue: initialize number of ctxs and hw_ctx before hctx initialization.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/blk-mq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 80cef0632079..3806b5affa23 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -632,6 +632,9 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_reg *reg,
blk_queue_rq_timeout(q, reg->timeout);
q->mq_ops = reg->ops;
+ q->nr_queues = nr_cpu_ids;
+ q->nr_hw_queues = reg->nr_hw_queues;
+
for_each_possible_cpu(i) {
struct blk_mq_ctx *__ctx = per_cpu_ptr(ctx, i);
@@ -644,9 +647,6 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_reg *reg,
INIT_LIST_HEAD(&__ctx->rq_list);
}
- q->nr_queues = nr_cpu_ids;
- q->nr_hw_queues = reg->nr_hw_queues;
-
/*
* Initialize hardware queues
*/