aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-01-11 08:13:27 -0500
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-01-11 11:44:53 -0500
commit1f5d78dc4823a85f112aaa2d0f17624f8c2a6c52 (patch)
treef6eeebf68d44bacf5aabc1d1c04b517deb3be495 /fs/ubifs
parent72f0d453d81d35087b1d3ad7c8285628c2be6e1d (diff)
UBIFS: make debugging messages light again
We switch to dynamic debugging in commit 56e46742e846e4de167dde0e1e1071ace1c882a5 but did not take into account that now we do not control anymore whether a specific message is enabled or not. So now we lock the "dbg_lock" and release it in every debugging macro, which make them not so light-weight. This commit removes the "dbg_lock" protection from the debugging macros to fix the issue. The downside is that now our DBGKEY() stuff is broken, but this is not critical at all and will be fixed later. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Cc: stable@kernel.org [3.0+]
Diffstat (limited to 'fs/ubifs')
-rw-r--r--fs/ubifs/debug.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h
index 8d9c46810189..164fd48c583a 100644
--- a/fs/ubifs/debug.h
+++ b/fs/ubifs/debug.h
@@ -175,19 +175,17 @@ const char *dbg_key_str1(const struct ubifs_info *c,
175 const union ubifs_key *key); 175 const union ubifs_key *key);
176 176
177/* 177/*
178 * DBGKEY macros require @dbg_lock to be held, which it is in the dbg message 178 * TODO: these macros are now broken because there is no locking around them
179 * macros. 179 * and we use a global buffer for the key string. This means that in case of
180 * concurrent execution we will end up with incorrect and messy key strings.
180 */ 181 */
181#define DBGKEY(key) dbg_key_str0(c, (key)) 182#define DBGKEY(key) dbg_key_str0(c, (key))
182#define DBGKEY1(key) dbg_key_str1(c, (key)) 183#define DBGKEY1(key) dbg_key_str1(c, (key))
183 184
184extern spinlock_t dbg_lock; 185extern spinlock_t dbg_lock;
185 186
186#define ubifs_dbg_msg(type, fmt, ...) do { \ 187#define ubifs_dbg_msg(type, fmt, ...) \
187 spin_lock(&dbg_lock); \ 188 pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__)
188 pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__); \
189 spin_unlock(&dbg_lock); \
190} while (0)
191 189
192/* Just a debugging messages not related to any specific UBIFS subsystem */ 190/* Just a debugging messages not related to any specific UBIFS subsystem */
193#define dbg_msg(fmt, ...) ubifs_dbg_msg("msg", fmt, ##__VA_ARGS__) 191#define dbg_msg(fmt, ...) ubifs_dbg_msg("msg", fmt, ##__VA_ARGS__)