@@ -308,3 +308,13 @@ void rq_qos_exit(struct request_queue *q)
rqos->ops->exit(rqos);
}
}
+
+void rq_qos_free(struct request_queue *q)
+{
+ while (q->rq_qos) {
+ struct rq_qos *rqos = q->rq_qos;
+
+ q->rq_qos = rqos->next;
+ rqos->ops->free(rqos);
+ }
+}
@@ -46,6 +46,7 @@ struct rq_qos_ops {
void (*cleanup)(struct rq_qos *, struct bio *);
void (*queue_depth_changed)(struct rq_qos *);
void (*exit)(struct rq_qos *);
+ void (*free)(struct rq_qos *);
const struct blk_mq_debugfs_attr *debugfs_attrs;
};
@@ -215,5 +216,6 @@ static inline void rq_qos_queue_depth_changed(struct request_queue *q)
}
void rq_qos_exit(struct request_queue *);
+void rq_qos_free(struct request_queue *);
#endif
Prepare to split the release of rq_qos from blk_cleanup_queue() to blk_release_queue() to fix a uaf problem, no functional changes. Signed-off-by: Yu Kuai <yukuai3@huawei.com> --- block/blk-rq-qos.c | 10 ++++++++++ block/blk-rq-qos.h | 2 ++ 2 files changed, 12 insertions(+)