aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/jbd/journal.c18
-rw-r--r--include/linux/jbd.h15
2 files changed, 24 insertions, 9 deletions
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index 6510d6355729..2d04f9afafd7 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -90,6 +90,24 @@ static int journal_convert_superblock_v1(journal_t *, journal_superblock_t *);
90static void __journal_abort_soft (journal_t *journal, int errno); 90static void __journal_abort_soft (journal_t *journal, int errno);
91static const char *journal_dev_name(journal_t *journal, char *buffer); 91static const char *journal_dev_name(journal_t *journal, char *buffer);
92 92
93#ifdef CONFIG_JBD_DEBUG
94void __jbd_debug(int level, const char *file, const char *func,
95 unsigned int line, const char *fmt, ...)
96{
97 struct va_format vaf;
98 va_list args;
99
100 if (level > journal_enable_debug)
101 return;
102 va_start(args, fmt);
103 vaf.fmt = fmt;
104 vaf.va = &args;
105 printk(KERN_DEBUG "%s: (%s, %u): %pV\n", file, func, line, &vaf);
106 va_end(args);
107}
108EXPORT_SYMBOL(__jbd_debug);
109#endif
110
93/* 111/*
94 * Helper function used to manage commit timeouts 112 * Helper function used to manage commit timeouts
95 */ 113 */
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index bc3e57d367fc..31229e0be90b 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -57,16 +57,13 @@
57#define JBD_EXPENSIVE_CHECKING 57#define JBD_EXPENSIVE_CHECKING
58extern u8 journal_enable_debug; 58extern u8 journal_enable_debug;
59 59
60#define jbd_debug(n, f, a...) \ 60void __jbd_debug(int level, const char *file, const char *func,
61 do { \ 61 unsigned int line, const char *fmt, ...);
62 if ((n) <= journal_enable_debug) { \ 62
63 printk (KERN_DEBUG "(%s, %d): %s: ", \ 63#define jbd_debug(n, fmt, a...) \
64 __FILE__, __LINE__, __func__); \ 64 __jbd_debug((n), __FILE__, __func__, __LINE__, (fmt), ##a)
65 printk (f, ## a); \
66 } \
67 } while (0)
68#else 65#else
69#define jbd_debug(f, a...) /**/ 66#define jbd_debug(n, fmt, a...) /**/
70#endif 67#endif
71 68
72static inline void *jbd_alloc(size_t size, gfp_t flags) 69static inline void *jbd_alloc(size_t size, gfp_t flags)