diff options
author | Christoph Hellwig <hch@lst.de> | 2023-02-03 18:03:54 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-02-03 18:20:05 +0300 |
commit | ce57b558604e68277d31ca5ce49ec4579a8618c5 (patch) | |
tree | 7660aacf0aa4ba3c61bce399935977954622b4d3 /block/blk-iolatency.c | |
parent | b494f9c566ba5fe2cc8abe67fdeb0332c6b48d4b (diff) | |
download | linux-ce57b558604e68277d31ca5ce49ec4579a8618c5.tar.xz |
blk-rq-qos: make rq_qos_add and rq_qos_del more useful
Switch to passing a gendisk, and make rq_qos_add initialize all required
fields and drop the not required q argument from rq_qos_del.
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/20230203150400.3199230-14-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-iolatency.c')
-rw-r--r-- | block/blk-iolatency.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index b55eac2cf919..1c394bd77aa0 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -757,24 +757,18 @@ static void blkiolatency_enable_work_fn(struct work_struct *work) int blk_iolatency_init(struct gendisk *disk) { - struct request_queue *q = disk->queue; struct blk_iolatency *blkiolat; - struct rq_qos *rqos; int ret; blkiolat = kzalloc(sizeof(*blkiolat), GFP_KERNEL); if (!blkiolat) return -ENOMEM; - rqos = &blkiolat->rqos; - rqos->id = RQ_QOS_LATENCY; - rqos->ops = &blkcg_iolatency_ops; - rqos->q = q; - - ret = rq_qos_add(q, rqos); + ret = rq_qos_add(&blkiolat->rqos, disk, RQ_QOS_LATENCY, + &blkcg_iolatency_ops); if (ret) goto err_free; - ret = blkcg_activate_policy(q, &blkcg_policy_iolatency); + ret = blkcg_activate_policy(disk->queue, &blkcg_policy_iolatency); if (ret) goto err_qos_del; @@ -784,7 +778,7 @@ int blk_iolatency_init(struct gendisk *disk) return 0; err_qos_del: - rq_qos_del(q, rqos); + rq_qos_del(&blkiolat->rqos); err_free: kfree(blkiolat); return ret; |