Skip to content

Commit

Permalink
blk-iocost: pass a gendisk to blk_iocost_init
Browse files Browse the repository at this point in the history
Pass the gendisk to blk_iocost_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-11-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Sep 27, 2022
1 parent 9df3e65 commit 57b6455
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions block/blk-iocost.c
Original file line number Diff line number Diff line change
Expand Up @@ -2828,8 +2828,9 @@ static struct rq_qos_ops ioc_rqos_ops = {
.exit = ioc_rqos_exit,
};

static int blk_iocost_init(struct request_queue *q)
static int blk_iocost_init(struct gendisk *disk)
{
struct request_queue *q = disk->queue;
struct ioc *ioc;
struct rq_qos *rqos;
int i, cpu, ret;
Expand Down Expand Up @@ -3178,7 +3179,7 @@ static ssize_t ioc_qos_write(struct kernfs_open_file *of, char *input,

ioc = q_to_ioc(bdev_get_queue(bdev));
if (!ioc) {
ret = blk_iocost_init(bdev_get_queue(bdev));
ret = blk_iocost_init(bdev->bd_disk);
if (ret)
goto err;
ioc = q_to_ioc(bdev_get_queue(bdev));
Expand Down Expand Up @@ -3345,7 +3346,7 @@ static ssize_t ioc_cost_model_write(struct kernfs_open_file *of, char *input,

ioc = q_to_ioc(bdev_get_queue(bdev));
if (!ioc) {
ret = blk_iocost_init(bdev_get_queue(bdev));
ret = blk_iocost_init(bdev->bd_disk);
if (ret)
goto err;
ioc = q_to_ioc(bdev_get_queue(bdev));
Expand Down

0 comments on commit 57b6455

Please sign in to comment.