summaryrefslogtreecommitdiffstats
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fb.com>2017-02-10 13:03:33 -0500
committerJens Axboe <axboe@fb.com>2017-02-10 11:15:01 -0700
commitf6f94300cda0f85180a0dd8838d1cc855661e239 (patch)
tree31d095416a52582e9cd9c6f6e4d906f429d65069 /block/blk-mq.c
parentf1ba82616c3368e1ae9e64ef29cf3edc1be0860d (diff)
downloadlinux-f6f94300cda0f85180a0dd8838d1cc855661e239.tar.bz2
block: set make_request_fn manually in blk_mq_update_nr_hw_queues
Calling blk_queue_make_request resets a bunch of settings on the request_queue, but all we really want is to update the make_request_fn, so do this directly so we don't lose things like the logical and physical block sizes. Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 7412191aee57..ade89197a4f1 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2629,10 +2629,14 @@ void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues)
list_for_each_entry(q, &set->tag_list, tag_set_list) {
blk_mq_realloc_hw_ctxs(set, q);
+ /*
+ * Manually set the make_request_fn as blk_queue_make_request
+ * resets a lot of the queue settings.
+ */
if (q->nr_hw_queues > 1)
- blk_queue_make_request(q, blk_mq_make_request);
+ q->make_request_fn = blk_mq_make_request;
else
- blk_queue_make_request(q, blk_sq_make_request);
+ q->make_request_fn = blk_sq_make_request;
blk_mq_queue_reinit(q, cpu_online_mask);
}