]> www.infradead.org Git - users/hch/block.git/commitdiff
blk-throttle pass a gendisk to blk_throtl_register_queue
authorChristoph Hellwig <hch@lst.de>
Fri, 9 Sep 2022 11:41:52 +0000 (13:41 +0200)
committerChristoph Hellwig <hch@lst.de>
Sun, 11 Sep 2022 06:07:32 +0000 (08:07 +0200)
Pass the gendisk to blk_throtl_register_queue as part of moving the
blk-cgroup infrastructure to be gendisk based.

Signed-off-by: Christoph Hellwig <hch@lst.de>
block/blk-sysfs.c
block/blk-throttle.c
block/blk-throttle.h

index e1f009aba6fd2ad6c3ca2a4f395658da72a1774a..e71b3b43927c0f65dcd447f8bb46eb1c4d79a2a8 100644 (file)
@@ -844,7 +844,7 @@ int blk_register_queue(struct gendisk *disk)
 
        blk_queue_flag_set(QUEUE_FLAG_REGISTERED, q);
        wbt_enable_default(q);
-       blk_throtl_register_queue(q);
+       blk_throtl_register(disk);
 
        /* Now everything is ready and send out KOBJ_ADD uevent */
        kobject_uevent(&q->kobj, KOBJ_ADD);
index 9147f2aec3d882e466fa5b01ef65d90cd5405c2f..27aa3203e4ab7fc3e39fae46d7be69003e58ddc0 100644 (file)
@@ -2365,8 +2365,9 @@ void blk_throtl_exit(struct gendisk *disk)
        kfree(q->td);
 }
 
-void blk_throtl_register_queue(struct request_queue *q)
+void blk_throtl_register(struct gendisk *disk)
 {
+       struct request_queue *q = disk->queue;
        struct throtl_data *td;
        int i;
 
index f445bab5051562dc70491978ad11d01e8455759b..7f54ccb9e090086eedf32ddfc65fd914765176f1 100644 (file)
@@ -161,13 +161,13 @@ static inline struct throtl_grp *blkg_to_tg(struct blkcg_gq *blkg)
 #ifndef CONFIG_BLK_DEV_THROTTLING
 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_queue(struct request_queue *q) { }
+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) { }
 #else /* CONFIG_BLK_DEV_THROTTLING */
 int blk_throtl_init(struct gendisk *disk);
 void blk_throtl_exit(struct gendisk *disk);
-void blk_throtl_register_queue(struct request_queue *q);
+void blk_throtl_register(struct gendisk *disk);
 bool __blk_throtl_bio(struct bio *bio);
 void blk_throtl_cancel_bios(struct request_queue *q);
 static inline bool blk_throtl_bio(struct bio *bio)