summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/debug.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-04-05 12:52:20 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-05-13 18:23:54 +0200
commitbc3f07f0906e867270fdc2006b0bbcb130a722c1 (patch)
treee290a98b57187896c2e5cefabc55a578f155803c /fs/ubifs/debug.c
parentUBIFS: improve space checking debugging feature (diff)
downloadlinux-bc3f07f0906e867270fdc2006b0bbcb130a722c1.tar.xz
linux-bc3f07f0906e867270fdc2006b0bbcb130a722c1.zip
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.c9
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 @@
#include <linux/moduleparam.h>
#include <linux/debugfs.h>
#include <linux/math64.h>
-#include <linux/slab.h>
#ifdef CONFIG_UBIFS_FS_DEBUG
@@ -2458,14 +2457,12 @@ error_dump:
return 0;
}
-static int invocation_cnt;
-
int dbg_force_in_the_gaps(void)
{
- if (!dbg_force_in_the_gaps_enabled)
+ if (!(ubifs_chk_flags & UBIFS_CHK_GEN))
return 0;
- /* Force in-the-gaps every 8th commit */
- return !((invocation_cnt++) & 0x7);
+
+ return !(random32() & 7);
}
/* Failure mode for recovery testing */