diff options
author | Ming Lei <ming.lei@redhat.com> | 2022-03-08 06:51:55 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-03-09 03:40:01 +0100 |
commit | 1059699f87eb0b3aa9d574b91a572d534897134a (patch) | |
tree | affbee31ae4a5aa5f88a7a8eb75a89a26d016332 /block/blk-core.c | |
parent | sr: implement ->free_disk to simplify refcounting (diff) | |
download | linux-1059699f87eb0b3aa9d574b91a572d534897134a.tar.xz linux-1059699f87eb0b3aa9d574b91a572d534897134a.zip |
block: move blkcg initialization/destroy into disk allocation/release handler
blkcg works on FS bio level, so it is reasonable to make both blkcg and
gendisk sharing same lifetime. Meantime there won't be any FS IO when
releasing disk, so safe to move blkcg initialization/destroy into disk
allocation/release handler
Long term, we can move blkcg into gendisk completely.
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20220308055200.735835-10-hch@lst.de
[axboe: fixup missing blk-cgroup.h include]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 4d858fc08f8b..3fa2f08d3750 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -496,17 +496,12 @@ struct request_queue *blk_alloc_queue(int node_id, bool alloc_srcu) PERCPU_REF_INIT_ATOMIC, GFP_KERNEL)) goto fail_stats; - if (blkcg_init_queue(q)) - goto fail_ref; - blk_queue_dma_alignment(q, 511); blk_set_default_limits(&q->limits); q->nr_requests = BLKDEV_DEFAULT_RQ; return q; -fail_ref: - percpu_ref_exit(&q->q_usage_counter); fail_stats: blk_free_queue_stats(q->stats); fail_split: |