Skip to content

Commit

Permalink
blk-mq: fix debugfs compilation issues
Browse files Browse the repository at this point in the history
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: 07e4fea ("blk-mq: create debugfs directory tree")
Signed-off-by: Omar Sandoval <osandov@fb.com>

Augment Kconfig description.

Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
osandov authored and axboe committed Jan 27, 2017
1 parent f3a8ab7 commit 400f73b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
12 changes: 12 additions & 0 deletions block/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,18 @@ 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 mostly useful for kernel developers, but it doesn't incur any cost
at runtime.

Unless you are building a kernel for a tiny system, you should
say Y here.

menu "Partition Types"

source "block/partitions/Kconfig"
Expand Down
2 changes: 1 addition & 1 deletion block/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 6 additions & 5 deletions block/blk-mq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit 400f73b

Please sign in to comment.