blk-mq: move debugfs declarations to a separate header file
authorOmar Sandoval <osandov@fb.com>
Thu, 4 May 2017 07:31:30 +0000 (00:31 -0700)
committerJens Axboe <axboe@fb.com>
Thu, 4 May 2017 14:23:44 +0000 (08:23 -0600)
Preparation for adding more declarations.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-core.c
block/blk-mq-debugfs.c
block/blk-mq-debugfs.h [new file with mode: 0644]
block/blk-mq-sysfs.c
block/blk-mq.h
block/blk-sysfs.c

index 24886b69690f08ffd832a694c74accf139ac8906..acdca6536562f5d8a99cc49f1e97f781312edb8c 100644 (file)
@@ -40,6 +40,7 @@
 
 #include "blk.h"
 #include "blk-mq.h"
+#include "blk-mq-debugfs.h"
 #include "blk-mq-sched.h"
 #include "blk-wbt.h"
 
index 347fbb8e059cf3e3e45b5b8071fa529f94038835..1dc1847b53636c2f69f64ec183229609982110e4 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/blk-mq.h>
 #include "blk.h"
 #include "blk-mq.h"
+#include "blk-mq-debugfs.h"
 #include "blk-mq-tag.h"
 
 struct blk_mq_debugfs_attr {
diff --git a/block/blk-mq-debugfs.h b/block/blk-mq-debugfs.h
new file mode 100644 (file)
index 0000000..00b0f71
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef INT_BLK_MQ_DEBUGFS_H
+#define INT_BLK_MQ_DEBUGFS_H
+
+#ifdef CONFIG_BLK_DEBUG_FS
+int blk_mq_debugfs_register(struct request_queue *q);
+void blk_mq_debugfs_unregister(struct request_queue *q);
+int blk_mq_debugfs_register_mq(struct request_queue *q);
+void blk_mq_debugfs_unregister_mq(struct request_queue *q);
+#else
+static inline int blk_mq_debugfs_register(struct request_queue *q)
+{
+       return 0;
+}
+
+static inline void blk_mq_debugfs_unregister(struct request_queue *q)
+{
+}
+
+static inline int blk_mq_debugfs_register_mq(struct request_queue *q)
+{
+       return 0;
+}
+
+static inline void blk_mq_debugfs_unregister_mq(struct request_queue *q)
+{
+}
+#endif
+
+#endif
index ec0afdf765e3939b520dec51fe02c9ec1b8a2d0c..71a237a90d434e2a8607e20fc57724d1298bae92 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <linux/blk-mq.h>
 #include "blk-mq.h"
+#include "blk-mq-debugfs.h"
 #include "blk-mq-tag.h"
 
 static void blk_mq_sysfs_release(struct kobject *kobj)
index 2814a14e529cdd18c58b3bb0f18663f803596167..cc67b48e3551d3d1b0fd02c083694a8856285f38 100644 (file)
@@ -83,34 +83,6 @@ extern int blk_mq_sysfs_register(struct request_queue *q);
 extern void blk_mq_sysfs_unregister(struct request_queue *q);
 extern void blk_mq_hctx_kobj_init(struct blk_mq_hw_ctx *hctx);
 
-/*
- * debugfs helpers
- */
-#ifdef CONFIG_BLK_DEBUG_FS
-int blk_mq_debugfs_register(struct request_queue *q);
-void blk_mq_debugfs_unregister(struct request_queue *q);
-int blk_mq_debugfs_register_mq(struct request_queue *q);
-void blk_mq_debugfs_unregister_mq(struct request_queue *q);
-#else
-static inline int blk_mq_debugfs_register(struct request_queue *q)
-{
-       return 0;
-}
-
-static inline void blk_mq_debugfs_unregister(struct request_queue *q)
-{
-}
-
-static inline int blk_mq_debugfs_register_mq(struct request_queue *q)
-{
-       return 0;
-}
-
-static inline void blk_mq_debugfs_unregister_mq(struct request_queue *q)
-{
-}
-#endif
-
 extern void blk_mq_rq_timed_out(struct request *req, bool reserved);
 
 void blk_mq_release(struct request_queue *q);
index 3f37813ccbafdf418f6875e69dbb8f5c4022e96e..9995355121d7cc41368f85fbc75ac16d6c971bfc 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "blk.h"
 #include "blk-mq.h"
+#include "blk-mq-debugfs.h"
 #include "blk-wbt.h"
 
 struct queue_sysfs_entry {