]> www.infradead.org Git - users/hch/block.git/commitdiff
blk-throttle pass a gendisk to blk_throtl_cancel_bios
authorChristoph Hellwig <hch@lst.de>
Fri, 9 Sep 2022 12:26:18 +0000 (14:26 +0200)
committerChristoph Hellwig <hch@lst.de>
Sun, 11 Sep 2022 06:07:32 +0000 (08:07 +0200)
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 <hch@lst.de>
block/blk-throttle.c
block/blk-throttle.h
block/genhd.c

index 27aa3203e4ab7fc3e39fae46d7be69003e58ddc0..fc8f64beeb78ca5fb99cb73fb153aa96a2ae936d 100644 (file)
@@ -1673,8 +1673,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;
 
index 7f54ccb9e090086eedf32ddfc65fd914765176f1..ab31260070f183353581c86f19fcb25bcd652aff 100644 (file)
@@ -163,13 +163,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_throtl_bio(struct bio *bio)
 {
        struct throtl_grp *tg = blkg_to_tg(bio->bi_blkg);
index f1af045fac2fe08f6537f35d152ebecfae6e2dca..d6a21803a57e2bb563f4047a456f555bd0caada9 100644 (file)
@@ -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();