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.h51
1 files changed, 43 insertions, 8 deletions
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h
index 33d6b95071e4..d6ea1362d56a 100644
--- a/fs/ubifs/debug.h
+++ b/fs/ubifs/debug.h
@@ -25,7 +25,43 @@
25 25
26#ifdef CONFIG_UBIFS_FS_DEBUG 26#ifdef CONFIG_UBIFS_FS_DEBUG
27 27
28#define UBIFS_DBG(op) op 28/**
29 * ubifs_debug_info - per-FS debugging information.
30 * @buf: a buffer of LEB size, used for various purposes
31 * @old_zroot: old index root - used by 'dbg_check_old_index()'
32 * @old_zroot_level: old index root level - used by 'dbg_check_old_index()'
33 * @old_zroot_sqnum: old index root sqnum - used by 'dbg_check_old_index()'
34 * @failure_mode: failure mode for recovery testing
35 * @fail_delay: 0=>don't delay, 1=>delay a time, 2=>delay a number of calls
36 * @fail_timeout: time in jiffies when delay of failure mode expires
37 * @fail_cnt: current number of calls to failure mode I/O functions
38 * @fail_cnt_max: number of calls by which to delay failure mode
39 * @chk_lpt_sz: used by LPT tree size checker
40 * @chk_lpt_sz2: used by LPT tree size checker
41 * @chk_lpt_wastage: used by LPT tree size checker
42 * @chk_lpt_lebs: used by LPT tree size checker
43 * @new_nhead_offs: used by LPT tree size checker
44 * @new_ihead_lnum: used by debugging to check ihead_lnum
45 * @new_ihead_offs: used by debugging to check ihead_offs
46 */
47struct ubifs_debug_info {
48 void *buf;
49 struct ubifs_zbranch old_zroot;
50 int old_zroot_level;
51 unsigned long long old_zroot_sqnum;
52 int failure_mode;
53 int fail_delay;
54 unsigned long fail_timeout;
55 unsigned int fail_cnt;
56 unsigned int fail_cnt_max;
57 long long chk_lpt_sz;
58 long long chk_lpt_sz2;
59 long long chk_lpt_wastage;
60 int chk_lpt_lebs;
61 int new_nhead_offs;
62 int new_ihead_lnum;
63 int new_ihead_offs;
64};
29 65
30#define ubifs_assert(expr) do { \ 66#define ubifs_assert(expr) do { \
31 if (unlikely(!(expr))) { \ 67 if (unlikely(!(expr))) { \
@@ -211,6 +247,9 @@ extern unsigned int ubifs_msg_flags;
211extern unsigned int ubifs_chk_flags; 247extern unsigned int ubifs_chk_flags;
212extern unsigned int ubifs_tst_flags; 248extern unsigned int ubifs_tst_flags;
213 249
250int ubifs_debugging_init(struct ubifs_info *c);
251void ubifs_debugging_exit(struct ubifs_info *c);
252
214/* Dump functions */ 253/* Dump functions */
215 254
216const char *dbg_ntype(int type); 255const char *dbg_ntype(int type);
@@ -274,9 +313,6 @@ int dbg_force_in_the_gaps(void);
274 313
275#define dbg_failure_mode (ubifs_tst_flags & UBIFS_TST_RCVRY) 314#define dbg_failure_mode (ubifs_tst_flags & UBIFS_TST_RCVRY)
276 315
277void dbg_failure_mode_registration(struct ubifs_info *c);
278void dbg_failure_mode_deregistration(struct ubifs_info *c);
279
280#ifndef UBIFS_DBG_PRESERVE_UBI 316#ifndef UBIFS_DBG_PRESERVE_UBI
281 317
282#define ubi_leb_read dbg_leb_read 318#define ubi_leb_read dbg_leb_read
@@ -320,8 +356,6 @@ static inline int dbg_change(struct ubi_volume_desc *desc, int lnum,
320 356
321#else /* !CONFIG_UBIFS_FS_DEBUG */ 357#else /* !CONFIG_UBIFS_FS_DEBUG */
322 358
323#define UBIFS_DBG(op)
324
325/* Use "if (0)" to make compiler check arguments even if debugging is off */ 359/* Use "if (0)" to make compiler check arguments even if debugging is off */
326#define ubifs_assert(expr) do { \ 360#define ubifs_assert(expr) do { \
327 if (0 && (expr)) \ 361 if (0 && (expr)) \
@@ -360,6 +394,9 @@ static inline int dbg_change(struct ubi_volume_desc *desc, int lnum,
360#define DBGKEY(key) ((char *)(key)) 394#define DBGKEY(key) ((char *)(key))
361#define DBGKEY1(key) ((char *)(key)) 395#define DBGKEY1(key) ((char *)(key))
362 396
397#define ubifs_debugging_init(c) 0
398#define ubifs_debugging_exit(c) ({})
399
363#define dbg_ntype(type) "" 400#define dbg_ntype(type) ""
364#define dbg_cstate(cmt_state) "" 401#define dbg_cstate(cmt_state) ""
365#define dbg_get_key_dump(c, key) ({}) 402#define dbg_get_key_dump(c, key) ({})
@@ -396,8 +433,6 @@ static inline int dbg_change(struct ubi_volume_desc *desc, int lnum,
396#define dbg_force_in_the_gaps_enabled 0 433#define dbg_force_in_the_gaps_enabled 0
397#define dbg_force_in_the_gaps() 0 434#define dbg_force_in_the_gaps() 0
398#define dbg_failure_mode 0 435#define dbg_failure_mode 0
399#define dbg_failure_mode_registration(c) ({})
400#define dbg_failure_mode_deregistration(c) ({})
401 436
402#endif /* !CONFIG_UBIFS_FS_DEBUG */ 437#endif /* !CONFIG_UBIFS_FS_DEBUG */
403 438