aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/debug.h')
-rw-r--r--fs/jffs2/debug.h50
1 files changed, 17 insertions, 33 deletions
diff --git a/fs/jffs2/debug.h b/fs/jffs2/debug.h
index c4f8eef5ca68..4fd9be4cbc98 100644
--- a/fs/jffs2/debug.h
+++ b/fs/jffs2/debug.h
@@ -51,6 +51,7 @@
51 * superseded by nicer dbg_xxx() macros... 51 * superseded by nicer dbg_xxx() macros...
52 */ 52 */
53#if CONFIG_JFFS2_FS_DEBUG > 0 53#if CONFIG_JFFS2_FS_DEBUG > 0
54#define DEBUG
54#define D1(x) x 55#define D1(x) x
55#else 56#else
56#define D1(x) 57#define D1(x)
@@ -62,50 +63,33 @@
62#define D2(x) 63#define D2(x)
63#endif 64#endif
64 65
66#define jffs2_dbg(level, fmt, ...) \
67do { \
68 if (CONFIG_JFFS2_FS_DEBUG >= level) \
69 pr_debug(fmt, ##__VA_ARGS__); \
70} while (0)
71
65/* The prefixes of JFFS2 messages */ 72/* The prefixes of JFFS2 messages */
73#define JFFS2_DBG KERN_DEBUG
66#define JFFS2_DBG_PREFIX "[JFFS2 DBG]" 74#define JFFS2_DBG_PREFIX "[JFFS2 DBG]"
67#define JFFS2_ERR_PREFIX "JFFS2 error:"
68#define JFFS2_WARN_PREFIX "JFFS2 warning:"
69#define JFFS2_NOTICE_PREFIX "JFFS2 notice:"
70
71#define JFFS2_ERR KERN_ERR
72#define JFFS2_WARN KERN_WARNING
73#define JFFS2_NOT KERN_NOTICE
74#define JFFS2_DBG KERN_DEBUG
75
76#define JFFS2_DBG_MSG_PREFIX JFFS2_DBG JFFS2_DBG_PREFIX 75#define JFFS2_DBG_MSG_PREFIX JFFS2_DBG JFFS2_DBG_PREFIX
77#define JFFS2_ERR_MSG_PREFIX JFFS2_ERR JFFS2_ERR_PREFIX
78#define JFFS2_WARN_MSG_PREFIX JFFS2_WARN JFFS2_WARN_PREFIX
79#define JFFS2_NOTICE_MSG_PREFIX JFFS2_NOT JFFS2_NOTICE_PREFIX
80 76
81/* JFFS2 message macros */ 77/* JFFS2 message macros */
82#define JFFS2_ERROR(fmt, ...) \ 78#define JFFS2_ERROR(fmt, ...) \
83 do { \ 79 pr_err("error: (%d) %s: " fmt, \
84 printk(JFFS2_ERR_MSG_PREFIX \ 80 task_pid_nr(current), __func__, ##__VA_ARGS__)
85 " (%d) %s: " fmt, task_pid_nr(current), \
86 __func__ , ##__VA_ARGS__); \
87 } while(0)
88 81
89#define JFFS2_WARNING(fmt, ...) \ 82#define JFFS2_WARNING(fmt, ...) \
90 do { \ 83 pr_warn("warning: (%d) %s: " fmt, \
91 printk(JFFS2_WARN_MSG_PREFIX \ 84 task_pid_nr(current), __func__, ##__VA_ARGS__)
92 " (%d) %s: " fmt, task_pid_nr(current), \
93 __func__ , ##__VA_ARGS__); \
94 } while(0)
95 85
96#define JFFS2_NOTICE(fmt, ...) \ 86#define JFFS2_NOTICE(fmt, ...) \
97 do { \ 87 pr_notice("notice: (%d) %s: " fmt, \
98 printk(JFFS2_NOTICE_MSG_PREFIX \ 88 task_pid_nr(current), __func__, ##__VA_ARGS__)
99 " (%d) %s: " fmt, task_pid_nr(current), \
100 __func__ , ##__VA_ARGS__); \
101 } while(0)
102 89
103#define JFFS2_DEBUG(fmt, ...) \ 90#define JFFS2_DEBUG(fmt, ...) \
104 do { \ 91 printk(KERN_DEBUG "[JFFS2 DBG] (%d) %s: " fmt, \
105 printk(JFFS2_DBG_MSG_PREFIX \ 92 task_pid_nr(current), __func__, ##__VA_ARGS__)
106 " (%d) %s: " fmt, task_pid_nr(current), \
107 __func__ , ##__VA_ARGS__); \
108 } while(0)
109 93
110/* 94/*
111 * We split our debugging messages on several parts, depending on the JFFS2 95 * We split our debugging messages on several parts, depending on the JFFS2