@@ -1,19 +1,14 @@
-#ifndef BLK_MQ_SCHED_H
-#define BLK_MQ_SCHED_H
+#ifndef INT_BLK_MQ_SCHED_H
+#define INT_BLK_MQ_SCHED_H
#include "blk-mq.h"
#include "blk-mq-tag.h"
-void blk_mq_sched_free_hctx_data(struct request_queue *q,
- void (*exit)(struct blk_mq_hw_ctx *));
+#include <linux/blk-mq-sched.h>
void blk_mq_sched_assign_ioc(struct request *rq, struct bio *bio);
-void blk_mq_sched_request_inserted(struct request *rq);
-bool blk_mq_sched_try_merge(struct request_queue *q, struct bio *bio,
- struct request **merged_request);
bool __blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio);
-bool blk_mq_sched_try_insert_merge(struct request_queue *q, struct request *rq);
void blk_mq_sched_restart(struct blk_mq_hw_ctx *hctx);
void blk_mq_sched_insert_request(struct request *rq, bool at_head,
new file mode 100644
@@ -0,0 +1,14 @@
+#ifndef BLK_MQ_SCHED_H
+#define BLK_MQ_SCHED_H
+
+/*
+ * Scheduler helper functions.
+ */
+void blk_mq_sched_free_hctx_data(struct request_queue *q,
+ void (*exit)(struct blk_mq_hw_ctx *));
+void blk_mq_sched_request_inserted(struct request *rq);
+bool blk_mq_sched_try_merge(struct request_queue *q, struct bio *bio,
+ struct request **merged_request);
+bool blk_mq_sched_try_insert_merge(struct request_queue *q, struct request *rq);
+
+#endif
The functions blk_mq_sched_free_hctx_data(), blk_mq_sched_try_merge(), blk_mq_sched_try_insert_merge() and blk_mq_sched_request_inserted() are all exported symbols but are declared only internally in block/blk-mq-sched.h. Move these declarations to the new file include/linux/blk-mq-sched.h to make them available to block scheduler modules implemented outside of the block directory. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> --- block/blk-mq-sched.h | 11 +++-------- include/linux/blk-mq-sched.h | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 include/linux/blk-mq-sched.h