diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-09-18 13:38:55 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-09-18 13:38:55 -0400 |
commit | 6ba495e9259cd9a0b40ebd6c315143535c92542f (patch) | |
tree | 7d43ea10a8971087e6e8b00c9934b0cf83e53d1e /fs/ext4/mballoc.h | |
parent | 91cc219ad963731191247c5f2db4118be2bc341a (diff) |
ext4: Add configurable run-time mballoc debugging
Allow mballoc debugging to be enabled at run-time instead of just at
compile time.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mballoc.h')
-rw-r--r-- | fs/ext4/mballoc.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/ext4/mballoc.h b/fs/ext4/mballoc.h index c96bb19f58f9..9db890d4d275 100644 --- a/fs/ext4/mballoc.h +++ b/fs/ext4/mballoc.h @@ -37,11 +37,19 @@ /* */ -#define MB_DEBUG__ -#ifdef MB_DEBUG -#define mb_debug(fmt, a...) printk(fmt, ##a) +#ifdef CONFIG_EXT4_DEBUG +extern u8 mb_enable_debug; + +#define mb_debug(n, fmt, a...) \ + do { \ + if ((n) <= mb_enable_debug) { \ + printk(KERN_DEBUG "(%s, %d): %s: ", \ + __FILE__, __LINE__, __func__); \ + printk(fmt, ## a); \ + } \ + } while (0) #else -#define mb_debug(fmt, a...) +#define mb_debug(n, fmt, a...) #endif /* |