diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-10-31 05:42:18 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-12-03 06:14:34 -0500 |
commit | 45e12d901fee57bccf90f6940155724954e1aac7 (patch) | |
tree | 7b42cbfdbe35455871a412aab535f481fb2c1c44 /fs | |
parent | 552ff3179d1e93a3e982357544c059f3e9a5516e (diff) |
UBIFS: run debugging checks only if they are enabled
Do not forget to check whether lpt debugging is enabled before
running the check functions. This commit also makes some spelling
fixes.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ubifs/lpt.c | 3 | ||||
-rw-r--r-- | fs/ubifs/lpt_commit.c | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/fs/ubifs/lpt.c b/fs/ubifs/lpt.c index db8bd0e518b2..93c181c742f2 100644 --- a/fs/ubifs/lpt.c +++ b/fs/ubifs/lpt.c | |||
@@ -36,7 +36,7 @@ | |||
36 | * can be written into a single eraseblock. In that case, garbage collection | 36 | * can be written into a single eraseblock. In that case, garbage collection |
37 | * consists of just writing the whole table, which therefore makes all other | 37 | * consists of just writing the whole table, which therefore makes all other |
38 | * eraseblocks reusable. In the case of the big model, dirty eraseblocks are | 38 | * eraseblocks reusable. In the case of the big model, dirty eraseblocks are |
39 | * selected for garbage collection, which consists are marking the nodes in | 39 | * selected for garbage collection, which consists of marking the clean nodes in |
40 | * that LEB as dirty, and then only the dirty nodes are written out. Also, in | 40 | * that LEB as dirty, and then only the dirty nodes are written out. Also, in |
41 | * the case of the big model, a table of LEB numbers is saved so that the entire | 41 | * the case of the big model, a table of LEB numbers is saved so that the entire |
42 | * LPT does not to be scanned looking for empty eraseblocks when UBIFS is first | 42 | * LPT does not to be scanned looking for empty eraseblocks when UBIFS is first |
@@ -156,7 +156,6 @@ int ubifs_calc_lpt_geom(struct ubifs_info *c) | |||
156 | } | 156 | } |
157 | 157 | ||
158 | c->check_lpt_free = c->big_lpt; | 158 | c->check_lpt_free = c->big_lpt; |
159 | |||
160 | return 0; | 159 | return 0; |
161 | } | 160 | } |
162 | 161 | ||
diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c index 1aefab9f0b5e..7bbf03518c7f 100644 --- a/fs/ubifs/lpt_commit.c +++ b/fs/ubifs/lpt_commit.c | |||
@@ -1604,6 +1604,9 @@ static int dbg_check_ltab_lnum(struct ubifs_info *c, int lnum) | |||
1604 | int ret; | 1604 | int ret; |
1605 | void *buf = c->dbg->buf; | 1605 | void *buf = c->dbg->buf; |
1606 | 1606 | ||
1607 | if (!(ubifs_chk_flags & UBIFS_CHK_LPROPS)) | ||
1608 | return 0; | ||
1609 | |||
1607 | dbg_lp("LEB %d", lnum); | 1610 | dbg_lp("LEB %d", lnum); |
1608 | err = ubi_read(c->ubi, lnum, buf, 0, c->leb_size); | 1611 | err = ubi_read(c->ubi, lnum, buf, 0, c->leb_size); |
1609 | if (err) { | 1612 | if (err) { |
@@ -1704,6 +1707,9 @@ int dbg_chk_lpt_free_spc(struct ubifs_info *c) | |||
1704 | long long free = 0; | 1707 | long long free = 0; |
1705 | int i; | 1708 | int i; |
1706 | 1709 | ||
1710 | if (!(ubifs_chk_flags & UBIFS_CHK_LPROPS)) | ||
1711 | return 0; | ||
1712 | |||
1707 | for (i = 0; i < c->lpt_lebs; i++) { | 1713 | for (i = 0; i < c->lpt_lebs; i++) { |
1708 | if (c->ltab[i].tgc || c->ltab[i].cmt) | 1714 | if (c->ltab[i].tgc || c->ltab[i].cmt) |
1709 | continue; | 1715 | continue; |
@@ -1735,6 +1741,9 @@ int dbg_chk_lpt_sz(struct ubifs_info *c, int action, int len) | |||
1735 | long long chk_lpt_sz, lpt_sz; | 1741 | long long chk_lpt_sz, lpt_sz; |
1736 | int err = 0; | 1742 | int err = 0; |
1737 | 1743 | ||
1744 | if (!(ubifs_chk_flags & UBIFS_CHK_LPROPS)) | ||
1745 | return 0; | ||
1746 | |||
1738 | switch (action) { | 1747 | switch (action) { |
1739 | case 0: | 1748 | case 0: |
1740 | d->chk_lpt_sz = 0; | 1749 | d->chk_lpt_sz = 0; |