blk-iolatency: pass a gendisk to blk_iolatency_init
authorChristoph Hellwig <hch@lst.de>
Wed, 21 Sep 2022 18:04:52 +0000 (20:04 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 27 Sep 2022 01:17:24 +0000 (19:17 -0600)
Pass the gendisk to blk_iolatency_init as part of moving the blk-cgroup
infrastructure to be gendisk based.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andreas Herrmann <aherrmann@suse.de>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20220921180501.1539876-9-hch@lst.de
[axboe: missed inline for blk_iolatency_init() and !CONFIG_BLK_CGROUP_IOLATENCY]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-cgroup.c
block/blk-iolatency.c
block/blk.h

index 89974fd..82a117f 100644 (file)
@@ -1265,7 +1265,7 @@ int blkcg_init_disk(struct gendisk *disk)
        if (ret)
                goto err_ioprio_exit;
 
-       ret = blk_iolatency_init(q);
+       ret = blk_iolatency_init(disk);
        if (ret)
                goto err_throtl_exit;
 
index e285152..c6f61fe 100644 (file)
@@ -756,8 +756,9 @@ static void blkiolatency_enable_work_fn(struct work_struct *work)
        }
 }
 
-int blk_iolatency_init(struct request_queue *q)
+int blk_iolatency_init(struct gendisk *disk)
 {
+       struct request_queue *q = disk->queue;
        struct blk_iolatency *blkiolat;
        struct rq_qos *rqos;
        int ret;
index d7142c4..9f714c9 100644 (file)
@@ -389,9 +389,9 @@ static inline struct bio *blk_queue_bounce(struct bio *bio,
 }
 
 #ifdef CONFIG_BLK_CGROUP_IOLATENCY
-extern int blk_iolatency_init(struct request_queue *q);
+int blk_iolatency_init(struct gendisk *disk);
 #else
-static inline int blk_iolatency_init(struct request_queue *q) { return 0; }
+static inline int blk_iolatency_init(struct gendisk *disk) { return 0; };
 #endif
 
 #ifdef CONFIG_BLK_DEV_ZONED