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.c | |
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.c')
-rw-r--r-- | fs/ubifs/debug.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index 546ad575b660..06d171cefe45 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <linux/moduleparam.h> | 34 | #include <linux/moduleparam.h> |
35 | #include <linux/debugfs.h> | 35 | #include <linux/debugfs.h> |
36 | #include <linux/math64.h> | 36 | #include <linux/math64.h> |
37 | #include <linux/slab.h> | ||
38 | 37 | ||
39 | #ifdef CONFIG_UBIFS_FS_DEBUG | 38 | #ifdef CONFIG_UBIFS_FS_DEBUG |
40 | 39 | ||
@@ -2458,14 +2457,12 @@ error_dump: | |||
2458 | return 0; | 2457 | return 0; |
2459 | } | 2458 | } |
2460 | 2459 | ||
2461 | static int invocation_cnt; | ||
2462 | |||
2463 | int dbg_force_in_the_gaps(void) | 2460 | int dbg_force_in_the_gaps(void) |
2464 | { | 2461 | { |
2465 | if (!dbg_force_in_the_gaps_enabled) | 2462 | if (!(ubifs_chk_flags & UBIFS_CHK_GEN)) |
2466 | return 0; | 2463 | return 0; |
2467 | /* Force in-the-gaps every 8th commit */ | 2464 | |
2468 | return !((invocation_cnt++) & 0x7); | 2465 | return !(random32() & 7); |
2469 | } | 2466 | } |
2470 | 2467 | ||
2471 | /* Failure mode for recovery testing */ | 2468 | /* Failure mode for recovery testing */ |