diff mbox

[v2] blk-mq: fix debugfs compilation issues

Message ID 8ff253c312f1af002b99065b0a1e355af2d3ee9a.1485550075.git.osandov@fb.com (mailing list archive)
State New, archived
Headers show

Commit Message

Omar Sandoval Jan. 27, 2017, 8:49 p.m. UTC
From: Omar Sandoval <osandov@fb.com>

This fixes a couple of problems:

1. In the !CONFIG_DEBUG_FS case, the stub definitions were bogus.
2. In the !CONFIG_BLOCK case, blk-mq-debugfs.c shouldn't be compiled at
   all.

Fix the stub definitions and add a CONFIG_BLK_DEBUG_FS Kconfig option.

Fixes: 07e4fead45e6 ("blk-mq: create debugfs directory tree")
Signed-off-by: Omar Sandoval <osandov@fb.com>
---
 block/Kconfig  |  9 +++++++++
 block/Makefile |  2 +-
 block/blk-mq.h | 11 ++++++-----
 3 files changed, 16 insertions(+), 6 deletions(-)

Comments

Jens Axboe Jan. 27, 2017, 10:11 p.m. UTC | #1
On 01/27/2017 01:49 PM, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
> 
> This fixes a couple of problems:
> 
> 1. In the !CONFIG_DEBUG_FS case, the stub definitions were bogus.
> 2. In the !CONFIG_BLOCK case, blk-mq-debugfs.c shouldn't be compiled at
>    all.
> 
> Fix the stub definitions and add a CONFIG_BLK_DEBUG_FS Kconfig option.

Thanks, added.
diff mbox

Patch

diff --git a/block/Kconfig b/block/Kconfig
index 8bf114a3858a..0a31ed745258 100644
--- a/block/Kconfig
+++ b/block/Kconfig
@@ -147,6 +147,15 @@  config BLK_WBT_MQ
 	Multiqueue currently doesn't have support for IO scheduling,
 	enabling this option is recommended.
 
+config BLK_DEBUG_FS
+	bool "Block layer debugging information in debugfs"
+	default y
+	depends on DEBUG_FS
+	---help---
+	Include block layer debugging information in debugfs. This information
+	is only useful for kernel developers, but it doesn't incur any cost at
+	runtime.
+
 menu "Partition Types"
 
 source "block/partitions/Kconfig"
diff --git a/block/Makefile b/block/Makefile
index 6cabe6bd2882..317165f8708c 100644
--- a/block/Makefile
+++ b/block/Makefile
@@ -26,4 +26,4 @@  obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o blk-integrity.o t10-pi.o
 obj-$(CONFIG_BLK_MQ_PCI)	+= blk-mq-pci.o
 obj-$(CONFIG_BLK_DEV_ZONED)	+= blk-zoned.o
 obj-$(CONFIG_BLK_WBT)		+= blk-wbt.o
-obj-$(CONFIG_DEBUG_FS)		+= blk-mq-debugfs.o
+obj-$(CONFIG_BLK_DEBUG_FS)	+= blk-mq-debugfs.o
diff --git a/block/blk-mq.h b/block/blk-mq.h
index 57cdbf6c0cee..b52abd62b1b0 100644
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
@@ -84,7 +84,7 @@  extern void blk_mq_hctx_kobj_init(struct blk_mq_hw_ctx *hctx);
 /*
  * debugfs helpers
  */
-#ifdef CONFIG_DEBUG_FS
+#ifdef CONFIG_BLK_DEBUG_FS
 void blk_mq_debugfs_init(void);
 int blk_mq_debugfs_register(struct request_queue *q, const char *name);
 void blk_mq_debugfs_unregister(struct request_queue *q);
@@ -95,21 +95,22 @@  static inline void blk_mq_debugfs_init(void)
 {
 }
 
-int blk_mq_debugfs_register(struct request_queue *q, const char *name);
+static inline int blk_mq_debugfs_register(struct request_queue *q,
+					  const char *name)
 {
 	return 0;
 }
 
-void blk_mq_debugfs_unregister(struct request_queue *q)
+static inline void blk_mq_debugfs_unregister(struct request_queue *q)
 {
 }
 
-int blk_mq_debugfs_register_hctxs(struct request_queue *q)
+static inline int blk_mq_debugfs_register_hctxs(struct request_queue *q)
 {
 	return 0;
 }
 
-void blk_mq_debugfs_unregister_hctxs(struct request_queue *q)
+static inline void blk_mq_debugfs_unregister_hctxs(struct request_queue *q)
 {
 }
 #endif