diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-04-05 06:52:20 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-05-13 12:23:54 -0400 |
commit | bc3f07f0906e867270fdc2006b0bbcb130a722c1 (patch) | |
tree | e290a98b57187896c2e5cefabc55a578f155803c /fs/ubifs/debug.h | |
parent | f1bd66afb14c25095cf6ff499c1388db423acc9e (diff) |
UBIFS: make force in-the-gaps to be a general self-check
UBIFS can force itself to use the 'in-the-gaps' commit method - the last resort
method which is normally invoced very very rarely. Currently this "force
int-the-gaps" debugging feature is a separate test mode. But it is a bit saner
to make it to be the "general" self-test check instead.
This patch is just a clean-up which should make the debugging code look a bit
nicer and easier to use - we have way too many debugging options.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/debug.h')
-rw-r--r-- | fs/ubifs/debug.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h index 6b5fe7ba0296..8934c12f108e 100644 --- a/fs/ubifs/debug.h +++ b/fs/ubifs/debug.h | |||
@@ -31,6 +31,8 @@ typedef int (*dbg_znode_callback)(struct ubifs_info *c, | |||
31 | 31 | ||
32 | #ifdef CONFIG_UBIFS_FS_DEBUG | 32 | #ifdef CONFIG_UBIFS_FS_DEBUG |
33 | 33 | ||
34 | #include <linux/random.h> | ||
35 | |||
34 | /** | 36 | /** |
35 | * ubifs_debug_info - per-FS debugging information. | 37 | * ubifs_debug_info - per-FS debugging information. |
36 | * @old_zroot: old index root - used by 'dbg_check_old_index()' | 38 | * @old_zroot: old index root - used by 'dbg_check_old_index()' |
@@ -237,11 +239,9 @@ enum { | |||
237 | /* | 239 | /* |
238 | * Special testing flags. | 240 | * Special testing flags. |
239 | * | 241 | * |
240 | * UBIFS_TST_FORCE_IN_THE_GAPS: force the use of in-the-gaps method | ||
241 | * UBIFS_TST_RCVRY: failure mode for recovery testing | 242 | * UBIFS_TST_RCVRY: failure mode for recovery testing |
242 | */ | 243 | */ |
243 | enum { | 244 | enum { |
244 | UBIFS_TST_FORCE_IN_THE_GAPS = 0x2, | ||
245 | UBIFS_TST_RCVRY = 0x4, | 245 | UBIFS_TST_RCVRY = 0x4, |
246 | }; | 246 | }; |
247 | 247 | ||
@@ -308,18 +308,16 @@ int dbg_check_data_nodes_order(struct ubifs_info *c, struct list_head *head); | |||
308 | int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head); | 308 | int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head); |
309 | 309 | ||
310 | /* Force the use of in-the-gaps method for testing */ | 310 | /* Force the use of in-the-gaps method for testing */ |
311 | 311 | static inline int dbg_force_in_the_gaps_enabled(void) | |
312 | #define dbg_force_in_the_gaps_enabled \ | 312 | { |
313 | (ubifs_tst_flags & UBIFS_TST_FORCE_IN_THE_GAPS) | 313 | return ubifs_chk_flags & UBIFS_CHK_GEN; |
314 | 314 | } | |
315 | int dbg_force_in_the_gaps(void); | 315 | int dbg_force_in_the_gaps(void); |
316 | 316 | ||
317 | /* Failure mode for recovery testing */ | 317 | /* Failure mode for recovery testing */ |
318 | |||
319 | #define dbg_failure_mode (ubifs_tst_flags & UBIFS_TST_RCVRY) | 318 | #define dbg_failure_mode (ubifs_tst_flags & UBIFS_TST_RCVRY) |
320 | 319 | ||
321 | #ifndef UBIFS_DBG_PRESERVE_UBI | 320 | #ifndef UBIFS_DBG_PRESERVE_UBI |
322 | |||
323 | #define ubi_leb_read dbg_leb_read | 321 | #define ubi_leb_read dbg_leb_read |
324 | #define ubi_leb_write dbg_leb_write | 322 | #define ubi_leb_write dbg_leb_write |
325 | #define ubi_leb_change dbg_leb_change | 323 | #define ubi_leb_change dbg_leb_change |
@@ -327,7 +325,6 @@ int dbg_force_in_the_gaps(void); | |||
327 | #define ubi_leb_unmap dbg_leb_unmap | 325 | #define ubi_leb_unmap dbg_leb_unmap |
328 | #define ubi_is_mapped dbg_is_mapped | 326 | #define ubi_is_mapped dbg_is_mapped |
329 | #define ubi_leb_map dbg_leb_map | 327 | #define ubi_leb_map dbg_leb_map |
330 | |||
331 | #endif | 328 | #endif |
332 | 329 | ||
333 | int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, | 330 | int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, |
@@ -488,8 +485,8 @@ dbg_check_nondata_nodes_order(struct ubifs_info *c, | |||
488 | struct list_head *head) { return 0; } | 485 | struct list_head *head) { return 0; } |
489 | 486 | ||
490 | static inline int dbg_force_in_the_gaps(void) { return 0; } | 487 | static inline int dbg_force_in_the_gaps(void) { return 0; } |
491 | #define dbg_force_in_the_gaps_enabled 0 | 488 | #define dbg_force_in_the_gaps_enabled() 0 |
492 | #define dbg_failure_mode 0 | 489 | #define dbg_failure_mode 0 |
493 | 490 | ||
494 | static inline int dbg_debugfs_init(void) { return 0; } | 491 | static inline int dbg_debugfs_init(void) { return 0; } |
495 | static inline void dbg_debugfs_exit(void) { return; } | 492 | static inline void dbg_debugfs_exit(void) { return; } |