aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/lpt_commit.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-06-03 01:31:29 -0400
committerArtem Bityutskiy <dedekind1@gmail.com>2011-07-04 03:54:28 -0400
commit2b1844a8c934723134ee1ff313e51d0d281cdef1 (patch)
tree1c490adba95a54eb14f9b00890ce9b09050358f7 /fs/ubifs/lpt_commit.c
parentd808efb407e1a2cf83a8d21411157195f26bdef9 (diff)
UBIFS: introduce helper functions for debugging checks and tests
This patch introduces helper functions for all debugging checks, so instead of doing if (!(ubifs_chk_flags & UBIFS_CHK_GEN)) we now do if (!dbg_is_chk_gen(c)) This is a preparation to further changes where the flags will go away, and we'll need to only change the helper functions, but the code which utilizes them won't be touched. At the same time this patch removes 'dbg_force_in_the_gaps()', 'dbg_force_in_the_gaps_enabled()', and dbg_failure_mode helpers for consistency. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/lpt_commit.c')
-rw-r--r--fs/ubifs/lpt_commit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c
index 254e8d32fc67..f8e286ba8095 100644
--- a/fs/ubifs/lpt_commit.c
+++ b/fs/ubifs/lpt_commit.c
@@ -1640,7 +1640,7 @@ static int dbg_check_ltab_lnum(struct ubifs_info *c, int lnum)
1640 int ret; 1640 int ret;
1641 void *buf, *p; 1641 void *buf, *p;
1642 1642
1643 if (!(ubifs_chk_flags & UBIFS_CHK_LPROPS)) 1643 if (!dbg_is_chk_lprops(c))
1644 return 0; 1644 return 0;
1645 1645
1646 buf = p = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL); 1646 buf = p = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL);
@@ -1711,7 +1711,7 @@ int dbg_check_ltab(struct ubifs_info *c)
1711{ 1711{
1712 int lnum, err, i, cnt; 1712 int lnum, err, i, cnt;
1713 1713
1714 if (!(ubifs_chk_flags & UBIFS_CHK_LPROPS)) 1714 if (!dbg_is_chk_lprops(c))
1715 return 0; 1715 return 0;
1716 1716
1717 /* Bring the entire tree into memory */ 1717 /* Bring the entire tree into memory */
@@ -1754,7 +1754,7 @@ int dbg_chk_lpt_free_spc(struct ubifs_info *c)
1754 long long free = 0; 1754 long long free = 0;
1755 int i; 1755 int i;
1756 1756
1757 if (!(ubifs_chk_flags & UBIFS_CHK_LPROPS)) 1757 if (!dbg_is_chk_lprops(c))
1758 return 0; 1758 return 0;
1759 1759
1760 for (i = 0; i < c->lpt_lebs; i++) { 1760 for (i = 0; i < c->lpt_lebs; i++) {
@@ -1796,7 +1796,7 @@ int dbg_chk_lpt_sz(struct ubifs_info *c, int action, int len)
1796 long long chk_lpt_sz, lpt_sz; 1796 long long chk_lpt_sz, lpt_sz;
1797 int err = 0; 1797 int err = 0;
1798 1798
1799 if (!(ubifs_chk_flags & UBIFS_CHK_LPROPS)) 1799 if (!dbg_is_chk_lprops(c))
1800 return 0; 1800 return 0;
1801 1801
1802 switch (action) { 1802 switch (action) {
@@ -2019,7 +2019,7 @@ static int dbg_populate_lsave(struct ubifs_info *c)
2019 struct ubifs_lpt_heap *heap; 2019 struct ubifs_lpt_heap *heap;
2020 int i; 2020 int i;
2021 2021
2022 if (!(ubifs_chk_flags & UBIFS_CHK_GEN)) 2022 if (!dbg_is_chk_gen(c))
2023 return 0; 2023 return 0;
2024 if (random32() & 3) 2024 if (random32() & 3)
2025 return 0; 2025 return 0;