]> git.baikalelectronics.ru Git - kernel.git/commitdiff
block: move initialization of q->blkg_list into blkcg_init_queue
authorMing Lei <ming.lei@redhat.com>
Fri, 11 Feb 2022 10:11:48 +0000 (18:11 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 11 Feb 2022 17:02:41 +0000 (10:02 -0700)
q->blkg_list is only used by blkcg code, so move it into
blkcg_init_queue.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220211101149.2368042-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-cgroup.c
block/blk-core.c

index 671debbae9413d149c715dbd2a59f8da9feaf21c..35deaceba1f077f3af0e349d16505450a7643aee 100644 (file)
@@ -1175,6 +1175,8 @@ int blkcg_init_queue(struct request_queue *q)
        bool preloaded;
        int ret;
 
+       INIT_LIST_HEAD(&q->blkg_list);
+
        new_blkg = blkg_alloc(&blkcg_root, q, GFP_KERNEL);
        if (!new_blkg)
                return -ENOMEM;
index be8812f5489d47dc6c818d552f972a47d26eab1e..ff972b968f253125ed8f797c40f99565ecbaa0e1 100644 (file)
@@ -476,9 +476,6 @@ struct request_queue *blk_alloc_queue(int node_id, bool alloc_srcu)
        timer_setup(&q->timeout, blk_rq_timed_out_timer, 0);
        INIT_WORK(&q->timeout_work, blk_timeout_work);
        INIT_LIST_HEAD(&q->icq_list);
-#ifdef CONFIG_BLK_CGROUP
-       INIT_LIST_HEAD(&q->blkg_list);
-#endif
 
        kobject_init(&q->kobj, &blk_queue_ktype);