Skip to content

Commit

Permalink
blk-iocost: don't allow to configure bio based device
Browse files Browse the repository at this point in the history
iocost is based on rq_qos, which can only work for request based device,
thus it doesn't make sense to configure iocost for bio based device.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20230117070806.3857142-3-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Yu Kuai authored and Jens Axboe committed Jan 29, 2023
1 parent 7b7c5ae commit 235a5a8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions block/blk-iocost.c
Original file line number Diff line number Diff line change
Expand Up @@ -3187,6 +3187,11 @@ static ssize_t ioc_qos_write(struct kernfs_open_file *of, char *input,
return PTR_ERR(bdev);

disk = bdev->bd_disk;
if (!queue_is_mq(disk->queue)) {
ret = -EOPNOTSUPP;
goto err;
}

ioc = q_to_ioc(disk->queue);
if (!ioc) {
ret = blk_iocost_init(disk);
Expand Down Expand Up @@ -3367,6 +3372,11 @@ static ssize_t ioc_cost_model_write(struct kernfs_open_file *of, char *input,
return PTR_ERR(bdev);

q = bdev_get_queue(bdev);
if (!queue_is_mq(q)) {
ret = -EOPNOTSUPP;
goto err;
}

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

0 comments on commit 235a5a8

Please sign in to comment.