]> www.infradead.org Git - users/hch/block.git/commitdiff
blk-rq-qos: constify rq_qos_ops
authorChristoph Hellwig <hch@lst.de>
Fri, 9 Sep 2022 11:15:39 +0000 (13:15 +0200)
committerChristoph Hellwig <hch@lst.de>
Sun, 11 Sep 2022 06:07:33 +0000 (08:07 +0200)
These op vectors are constant, so mark them const.

Signed-off-by: Christoph Hellwig <hch@lst.de>
block/blk-iocost.c
block/blk-iolatency.c
block/blk-rq-qos.c
block/blk-rq-qos.h
block/blk-wbt.c

index ee134287adbf20b4d48144df4b620a4fabd2ab14..251f193432244c6bb9888f56ed47b670d25b6a38 100644 (file)
@@ -2819,7 +2819,7 @@ static void ioc_rqos_exit(struct rq_qos *rqos)
        kfree(ioc);
 }
 
-static struct rq_qos_ops ioc_rqos_ops = {
+static const struct rq_qos_ops ioc_rqos_ops = {
        .throttle = ioc_rqos_throttle,
        .merge = ioc_rqos_merge,
        .done_bio = ioc_rqos_done_bio,
index 4531e16f668174bc8f7afeb79cf883e5a298ebd7..d95c88c224f7c90a479a4ef3e645bdc831b008c6 100644 (file)
@@ -651,7 +651,7 @@ static void blkcg_iolatency_exit(struct rq_qos *rqos)
        kfree(blkiolat);
 }
 
-static struct rq_qos_ops blkcg_iolatency_ops = {
+static const struct rq_qos_ops blkcg_iolatency_ops = {
        .throttle = blkcg_iolatency_throttle,
        .done_bio = blkcg_iolatency_done_bio,
        .exit = blkcg_iolatency_exit,
index 14bee1bd761362f8bf6dddecd43760fa6c608583..8e83734cfe8dbcffbf97af444962920ef173dad4 100644 (file)
@@ -296,7 +296,7 @@ void rq_qos_exit(struct request_queue *q)
 }
 
 int rq_qos_add(struct rq_qos *rqos, struct gendisk *disk, enum rq_qos_id id,
-               struct rq_qos_ops *ops)
+               const struct rq_qos_ops *ops)
 {
        struct request_queue *q = disk->queue;
 
index c1968d52c370e8e6e071474dda2ccc1da9abc976..ee133781b229f46572009ced38bab217cf8b7a87 100644 (file)
@@ -26,7 +26,7 @@ struct rq_wait {
 };
 
 struct rq_qos {
-       struct rq_qos_ops *ops;
+       const struct rq_qos_ops *ops;
        struct request_queue *q;
        enum rq_qos_id id;
        struct rq_qos *next;
@@ -87,7 +87,7 @@ static inline void rq_wait_init(struct rq_wait *rq_wait)
 }
 
 int rq_qos_add(struct rq_qos *rqos, struct gendisk *disk, enum rq_qos_id id,
-               struct rq_qos_ops *ops);
+               const struct rq_qos_ops *ops);
 void rq_qos_del(struct rq_qos *rqos);
 
 typedef bool (acquire_inflight_cb_t)(struct rq_wait *rqw, void *private_data);
index bce379d9ac8ce3a59d1c2b716c03fc31d2fffa6a..cb8f1e01888a55d24d28d0d3016b575b6e4d1b69 100644 (file)
@@ -802,7 +802,7 @@ static const struct blk_mq_debugfs_attr wbt_debugfs_attrs[] = {
 };
 #endif
 
-static struct rq_qos_ops wbt_rqos_ops = {
+static const struct rq_qos_ops wbt_rqos_ops = {
        .throttle = wbt_wait,
        .issue = wbt_issue,
        .track = wbt_track,