From 9823538fb7efe66ce987a1e4c0e0f3dc882623c4 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 21 Sep 2022 20:04:50 +0200 Subject: blk-cgroup: pass a gendisk to blkcg_init_queue and blkcg_exit_queue Pass the gendisk to blkcg_init_disk and blkcg_exit_disk as part of moving the blk-cgroup infrastructure to be gendisk based. Also remove the rather pointless kerneldoc comments for these internal functions with a single caller each. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-7-hch@lst.de Signed-off-by: Jens Axboe --- block/genhd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'block/genhd.c') diff --git a/block/genhd.c b/block/genhd.c index d36fabf0abc1..f1af045fac2f 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1150,7 +1150,8 @@ static void disk_release(struct device *dev) !test_bit(GD_ADDED, &disk->state)) blk_mq_exit_queue(disk->queue); - blkcg_exit_queue(disk->queue); + blkcg_exit_disk(disk); + bioset_exit(&disk->bio_split); disk_release_events(disk); @@ -1363,7 +1364,7 @@ struct gendisk *__alloc_disk_node(struct request_queue *q, int node_id, if (xa_insert(&disk->part_tbl, 0, disk->part0, GFP_KERNEL)) goto out_destroy_part_tbl; - if (blkcg_init_queue(q)) + if (blkcg_init_disk(disk)) goto out_erase_part0; rand_initialize_disk(disk); -- cgit v1.2.3-59-g8ed1b From cad9266abcef586aa95f6f4095781e3e55473f2a Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 21 Sep 2022 20:04:58 +0200 Subject: blk-throttle: pass a gendisk to blk_throtl_cancel_bios Pass the gendisk to blk_throtl_cancel_bios as part of moving the blk-cgroup infrastructure to be gendisk based. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220921180501.1539876-15-hch@lst.de Signed-off-by: Jens Axboe --- block/blk-throttle.c | 3 ++- block/blk-throttle.h | 4 ++-- block/genhd.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'block/genhd.c') diff --git a/block/blk-throttle.c b/block/blk-throttle.c index def2775fa38e..847721dc2b2b 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -1716,8 +1716,9 @@ struct blkcg_policy blkcg_policy_throtl = { .pd_free_fn = throtl_pd_free, }; -void blk_throtl_cancel_bios(struct request_queue *q) +void blk_throtl_cancel_bios(struct gendisk *disk) { + struct request_queue *q = disk->queue; struct cgroup_subsys_state *pos_css; struct blkcg_gq *blkg; diff --git a/block/blk-throttle.h b/block/blk-throttle.h index 69b7f05314e4..ef4b7a4de987 100644 --- a/block/blk-throttle.h +++ b/block/blk-throttle.h @@ -172,13 +172,13 @@ static inline int blk_throtl_init(struct gendisk *disk) { return 0; } static inline void blk_throtl_exit(struct gendisk *disk) { } static inline void blk_throtl_register(struct gendisk *disk) { } static inline bool blk_throtl_bio(struct bio *bio) { return false; } -static inline void blk_throtl_cancel_bios(struct request_queue *q) { } +static inline void blk_throtl_cancel_bios(struct gendisk *disk) { } #else /* CONFIG_BLK_DEV_THROTTLING */ int blk_throtl_init(struct gendisk *disk); void blk_throtl_exit(struct gendisk *disk); void blk_throtl_register(struct gendisk *disk); bool __blk_throtl_bio(struct bio *bio); -void blk_throtl_cancel_bios(struct request_queue *q); +void blk_throtl_cancel_bios(struct gendisk *disk); static inline bool blk_should_throtl(struct bio *bio) { diff --git a/block/genhd.c b/block/genhd.c index f1af045fac2f..d6a21803a57e 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -626,7 +626,7 @@ void del_gendisk(struct gendisk *disk) pm_runtime_set_memalloc_noio(disk_to_dev(disk), false); device_del(disk_to_dev(disk)); - blk_throtl_cancel_bios(disk->queue); + blk_throtl_cancel_bios(disk); blk_sync_queue(q); blk_flush_integrity(); -- cgit v1.2.3-59-g8ed1b