aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs/debug.h')
-rw-r--r--fs/ubifs/debug.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h
index 981a3fa081f3..64c6977c189b 100644
--- a/fs/ubifs/debug.h
+++ b/fs/ubifs/debug.h
@@ -148,18 +148,20 @@ struct ubifs_global_debug_info {
148 unsigned int tst_rcvry:1; 148 unsigned int tst_rcvry:1;
149}; 149};
150 150
151void ubifs_assert_failed(struct ubifs_info *c, const char *expr,
152 const char *file, int line);
153
151#define ubifs_assert(c, expr) do { \ 154#define ubifs_assert(c, expr) do { \
152 if (unlikely(!(expr))) { \ 155 if (unlikely(!(expr))) { \
153 pr_crit("UBIFS assert failed in %s at %u (pid %d)\n", \ 156 ubifs_assert_failed((struct ubifs_info *)c, #expr, __FILE__, \
154 __func__, __LINE__, current->pid); \ 157 __LINE__); \
155 dump_stack(); \
156 } \ 158 } \
157} while (0) 159} while (0)
158 160
159#define ubifs_assert_cmt_locked(c) do { \ 161#define ubifs_assert_cmt_locked(c) do { \
160 if (unlikely(down_write_trylock(&(c)->commit_sem))) { \ 162 if (unlikely(down_write_trylock(&(c)->commit_sem))) { \
161 up_write(&(c)->commit_sem); \ 163 up_write(&(c)->commit_sem); \
162 pr_crit("commit lock is not locked!\n"); \ 164 ubifs_err(c, "commit lock is not locked!\n"); \
163 ubifs_assert(c, 0); \ 165 ubifs_assert(c, 0); \
164 } \ 166 } \
165} while (0) 167} while (0)