block: Remove request_queue.nr_queues
authorBart Van Assche <bvanassche@acm.org>
Mon, 30 Sep 2019 23:00:42 +0000 (16:00 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 7 Oct 2019 14:31:59 +0000 (08:31 -0600)
Commit 897bb0c7f1ea ("blk-mq: Use proper cpumask iterator"; v4.6)
removed the last use of request_queue.nr_queues from outside
blk_mq_init_allocate_queue(). Remove this member variable to make
struct request_queue smaller. This patch does not change any
functionality.

Cc: Christoph Hellwig <hch@infradead.org>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c
include/linux/blkdev.h

index ec79115..9d93293 100644 (file)
@@ -2876,9 +2876,9 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,
        /* init q->mq_kobj and sw queues' kobjects */
        blk_mq_sysfs_init(q);
 
-       q->nr_queues = nr_hw_queues(set);
-       q->queue_hw_ctx = kcalloc_node(q->nr_queues, sizeof(*(q->queue_hw_ctx)),
-                                               GFP_KERNEL, set->numa_node);
+       q->queue_hw_ctx = kcalloc_node(nr_hw_queues(set),
+                                      sizeof(*(q->queue_hw_ctx)), GFP_KERNEL,
+                                      set->numa_node);
        if (!q->queue_hw_ctx)
                goto err_sys_init;
 
index f3ea78b..d4051ac 100644 (file)
@@ -411,7 +411,6 @@ struct request_queue {
 
        /* sw queues */
        struct blk_mq_ctx __percpu      *queue_ctx;
-       unsigned int            nr_queues;
 
        unsigned int            queue_depth;