diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-05-16 13:11:23 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-05-16 13:11:23 -0400 |
commit | a6aae4dd0ffad299a33d122f8a339b399bee5381 (patch) | |
tree | 958b015be27d97d079a3c14694576571ca916600 /fs/ubifs | |
parent | f70b7e52aa23c9aea5346b9730b402fb55f9079b (diff) |
UBIFS: get rid of dbg_err
This patch removes the 'dbg_err()' macro and we now use 'ubifs_err()' instead.
The idea of 'dbg_err()' was to compile out some error message to make the
binary a bit smaller - but I think it was a bad idea.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/commit.c | 4 | ||||
-rw-r--r-- | fs/ubifs/debug.c | 30 | ||||
-rw-r--r-- | fs/ubifs/debug.h | 4 | ||||
-rw-r--r-- | fs/ubifs/lpt.c | 43 | ||||
-rw-r--r-- | fs/ubifs/lpt_commit.c | 44 | ||||
-rw-r--r-- | fs/ubifs/orphan.c | 4 | ||||
-rw-r--r-- | fs/ubifs/recovery.c | 22 | ||||
-rw-r--r-- | fs/ubifs/replay.c | 20 | ||||
-rw-r--r-- | fs/ubifs/scan.c | 12 | ||||
-rw-r--r-- | fs/ubifs/super.c | 14 | ||||
-rw-r--r-- | fs/ubifs/tnc_misc.c | 32 | ||||
-rw-r--r-- | fs/ubifs/xattr.c | 4 |
12 files changed, 114 insertions, 119 deletions
diff --git a/fs/ubifs/commit.c b/fs/ubifs/commit.c index 5da20c193634..8eda717cb99b 100644 --- a/fs/ubifs/commit.c +++ b/fs/ubifs/commit.c | |||
@@ -716,13 +716,13 @@ out: | |||
716 | return 0; | 716 | return 0; |
717 | 717 | ||
718 | out_dump: | 718 | out_dump: |
719 | dbg_err("dumping index node (iip=%d)", i->iip); | 719 | ubifs_err("dumping index node (iip=%d)", i->iip); |
720 | ubifs_dump_node(c, idx); | 720 | ubifs_dump_node(c, idx); |
721 | list_del(&i->list); | 721 | list_del(&i->list); |
722 | kfree(i); | 722 | kfree(i); |
723 | if (!list_empty(&list)) { | 723 | if (!list_empty(&list)) { |
724 | i = list_entry(list.prev, struct idx_node, list); | 724 | i = list_entry(list.prev, struct idx_node, list); |
725 | dbg_err("dumping parent index node"); | 725 | ubifs_err("dumping parent index node"); |
726 | ubifs_dump_node(c, &i->idx); | 726 | ubifs_dump_node(c, &i->idx); |
727 | } | 727 | } |
728 | out_free: | 728 | out_free: |
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index 3eef25343393..df83d7b495fc 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c | |||
@@ -1285,24 +1285,24 @@ static int dbg_check_key_order(struct ubifs_info *c, struct ubifs_zbranch *zbr1, | |||
1285 | err = 1; | 1285 | err = 1; |
1286 | key_read(c, &dent1->key, &key); | 1286 | key_read(c, &dent1->key, &key); |
1287 | if (keys_cmp(c, &zbr1->key, &key)) { | 1287 | if (keys_cmp(c, &zbr1->key, &key)) { |
1288 | dbg_err("1st entry at %d:%d has key %s", zbr1->lnum, | 1288 | ubifs_err("1st entry at %d:%d has key %s", zbr1->lnum, |
1289 | zbr1->offs, dbg_snprintf_key(c, &key, key_buf, | 1289 | zbr1->offs, dbg_snprintf_key(c, &key, key_buf, |
1290 | DBG_KEY_BUF_LEN)); | 1290 | DBG_KEY_BUF_LEN)); |
1291 | dbg_err("but it should have key %s according to tnc", | 1291 | ubifs_err("but it should have key %s according to tnc", |
1292 | dbg_snprintf_key(c, &zbr1->key, key_buf, | 1292 | dbg_snprintf_key(c, &zbr1->key, key_buf, |
1293 | DBG_KEY_BUF_LEN)); | 1293 | DBG_KEY_BUF_LEN)); |
1294 | ubifs_dump_node(c, dent1); | 1294 | ubifs_dump_node(c, dent1); |
1295 | goto out_free; | 1295 | goto out_free; |
1296 | } | 1296 | } |
1297 | 1297 | ||
1298 | key_read(c, &dent2->key, &key); | 1298 | key_read(c, &dent2->key, &key); |
1299 | if (keys_cmp(c, &zbr2->key, &key)) { | 1299 | if (keys_cmp(c, &zbr2->key, &key)) { |
1300 | dbg_err("2nd entry at %d:%d has key %s", zbr1->lnum, | 1300 | ubifs_err("2nd entry at %d:%d has key %s", zbr1->lnum, |
1301 | zbr1->offs, dbg_snprintf_key(c, &key, key_buf, | 1301 | zbr1->offs, dbg_snprintf_key(c, &key, key_buf, |
1302 | DBG_KEY_BUF_LEN)); | 1302 | DBG_KEY_BUF_LEN)); |
1303 | dbg_err("but it should have key %s according to tnc", | 1303 | ubifs_err("but it should have key %s according to tnc", |
1304 | dbg_snprintf_key(c, &zbr2->key, key_buf, | 1304 | dbg_snprintf_key(c, &zbr2->key, key_buf, |
1305 | DBG_KEY_BUF_LEN)); | 1305 | DBG_KEY_BUF_LEN)); |
1306 | ubifs_dump_node(c, dent2); | 1306 | ubifs_dump_node(c, dent2); |
1307 | goto out_free; | 1307 | goto out_free; |
1308 | } | 1308 | } |
@@ -1316,10 +1316,10 @@ static int dbg_check_key_order(struct ubifs_info *c, struct ubifs_zbranch *zbr1, | |||
1316 | goto out_free; | 1316 | goto out_free; |
1317 | } | 1317 | } |
1318 | if (cmp == 0 && nlen1 == nlen2) | 1318 | if (cmp == 0 && nlen1 == nlen2) |
1319 | dbg_err("2 xent/dent nodes with the same name"); | 1319 | ubifs_err("2 xent/dent nodes with the same name"); |
1320 | else | 1320 | else |
1321 | dbg_err("bad order of colliding key %s", | 1321 | ubifs_err("bad order of colliding key %s", |
1322 | dbg_snprintf_key(c, &key, key_buf, DBG_KEY_BUF_LEN)); | 1322 | dbg_snprintf_key(c, &key, key_buf, DBG_KEY_BUF_LEN)); |
1323 | 1323 | ||
1324 | ubifs_msg("first node at %d:%d\n", zbr1->lnum, zbr1->offs); | 1324 | ubifs_msg("first node at %d:%d\n", zbr1->lnum, zbr1->offs); |
1325 | ubifs_dump_node(c, dent1); | 1325 | ubifs_dump_node(c, dent1); |
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h index 7a6a9e279df1..6b3a9e2ee19c 100644 --- a/fs/ubifs/debug.h +++ b/fs/ubifs/debug.h | |||
@@ -159,10 +159,6 @@ struct ubifs_global_debug_info { | |||
159 | } \ | 159 | } \ |
160 | } while (0) | 160 | } while (0) |
161 | 161 | ||
162 | #define dbg_err(fmt, ...) do { \ | ||
163 | ubifs_err(fmt, ##__VA_ARGS__); \ | ||
164 | } while (0) | ||
165 | |||
166 | #define ubifs_dbg_msg(type, fmt, ...) \ | 162 | #define ubifs_dbg_msg(type, fmt, ...) \ |
167 | pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__) | 163 | pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__) |
168 | 164 | ||
diff --git a/fs/ubifs/lpt.c b/fs/ubifs/lpt.c index 5d1d97d00966..2054e8171fd4 100644 --- a/fs/ubifs/lpt.c +++ b/fs/ubifs/lpt.c | |||
@@ -2094,8 +2094,8 @@ static int dbg_chk_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode, | |||
2094 | int i; | 2094 | int i; |
2095 | 2095 | ||
2096 | if (pnode->num != col) { | 2096 | if (pnode->num != col) { |
2097 | dbg_err("pnode num %d expected %d parent num %d iip %d", | 2097 | ubifs_err("pnode num %d expected %d parent num %d iip %d", |
2098 | pnode->num, col, pnode->parent->num, pnode->iip); | 2098 | pnode->num, col, pnode->parent->num, pnode->iip); |
2099 | return -EINVAL; | 2099 | return -EINVAL; |
2100 | } | 2100 | } |
2101 | for (i = 0; i < UBIFS_LPT_FANOUT; i++) { | 2101 | for (i = 0; i < UBIFS_LPT_FANOUT; i++) { |
@@ -2109,14 +2109,14 @@ static int dbg_chk_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode, | |||
2109 | if (lnum >= c->leb_cnt) | 2109 | if (lnum >= c->leb_cnt) |
2110 | continue; | 2110 | continue; |
2111 | if (lprops->lnum != lnum) { | 2111 | if (lprops->lnum != lnum) { |
2112 | dbg_err("bad LEB number %d expected %d", | 2112 | ubifs_err("bad LEB number %d expected %d", |
2113 | lprops->lnum, lnum); | 2113 | lprops->lnum, lnum); |
2114 | return -EINVAL; | 2114 | return -EINVAL; |
2115 | } | 2115 | } |
2116 | if (lprops->flags & LPROPS_TAKEN) { | 2116 | if (lprops->flags & LPROPS_TAKEN) { |
2117 | if (cat != LPROPS_UNCAT) { | 2117 | if (cat != LPROPS_UNCAT) { |
2118 | dbg_err("LEB %d taken but not uncat %d", | 2118 | ubifs_err("LEB %d taken but not uncat %d", |
2119 | lprops->lnum, cat); | 2119 | lprops->lnum, cat); |
2120 | return -EINVAL; | 2120 | return -EINVAL; |
2121 | } | 2121 | } |
2122 | continue; | 2122 | continue; |
@@ -2128,8 +2128,8 @@ static int dbg_chk_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode, | |||
2128 | case LPROPS_FRDI_IDX: | 2128 | case LPROPS_FRDI_IDX: |
2129 | break; | 2129 | break; |
2130 | default: | 2130 | default: |
2131 | dbg_err("LEB %d index but cat %d", | 2131 | ubifs_err("LEB %d index but cat %d", |
2132 | lprops->lnum, cat); | 2132 | lprops->lnum, cat); |
2133 | return -EINVAL; | 2133 | return -EINVAL; |
2134 | } | 2134 | } |
2135 | } else { | 2135 | } else { |
@@ -2141,8 +2141,8 @@ static int dbg_chk_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode, | |||
2141 | case LPROPS_FREEABLE: | 2141 | case LPROPS_FREEABLE: |
2142 | break; | 2142 | break; |
2143 | default: | 2143 | default: |
2144 | dbg_err("LEB %d not index but cat %d", | 2144 | ubifs_err("LEB %d not index but cat %d", |
2145 | lprops->lnum, cat); | 2145 | lprops->lnum, cat); |
2146 | return -EINVAL; | 2146 | return -EINVAL; |
2147 | } | 2147 | } |
2148 | } | 2148 | } |
@@ -2182,24 +2182,24 @@ static int dbg_chk_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode, | |||
2182 | break; | 2182 | break; |
2183 | } | 2183 | } |
2184 | if (!found) { | 2184 | if (!found) { |
2185 | dbg_err("LEB %d cat %d not found in cat heap/list", | 2185 | ubifs_err("LEB %d cat %d not found in cat heap/list", |
2186 | lprops->lnum, cat); | 2186 | lprops->lnum, cat); |
2187 | return -EINVAL; | 2187 | return -EINVAL; |
2188 | } | 2188 | } |
2189 | switch (cat) { | 2189 | switch (cat) { |
2190 | case LPROPS_EMPTY: | 2190 | case LPROPS_EMPTY: |
2191 | if (lprops->free != c->leb_size) { | 2191 | if (lprops->free != c->leb_size) { |
2192 | dbg_err("LEB %d cat %d free %d dirty %d", | 2192 | ubifs_err("LEB %d cat %d free %d dirty %d", |
2193 | lprops->lnum, cat, lprops->free, | 2193 | lprops->lnum, cat, lprops->free, |
2194 | lprops->dirty); | 2194 | lprops->dirty); |
2195 | return -EINVAL; | 2195 | return -EINVAL; |
2196 | } | 2196 | } |
2197 | case LPROPS_FREEABLE: | 2197 | case LPROPS_FREEABLE: |
2198 | case LPROPS_FRDI_IDX: | 2198 | case LPROPS_FRDI_IDX: |
2199 | if (lprops->free + lprops->dirty != c->leb_size) { | 2199 | if (lprops->free + lprops->dirty != c->leb_size) { |
2200 | dbg_err("LEB %d cat %d free %d dirty %d", | 2200 | ubifs_err("LEB %d cat %d free %d dirty %d", |
2201 | lprops->lnum, cat, lprops->free, | 2201 | lprops->lnum, cat, lprops->free, |
2202 | lprops->dirty); | 2202 | lprops->dirty); |
2203 | return -EINVAL; | 2203 | return -EINVAL; |
2204 | } | 2204 | } |
2205 | } | 2205 | } |
@@ -2233,9 +2233,10 @@ int dbg_check_lpt_nodes(struct ubifs_info *c, struct ubifs_cnode *cnode, | |||
2233 | /* cnode is a nnode */ | 2233 | /* cnode is a nnode */ |
2234 | num = calc_nnode_num(row, col); | 2234 | num = calc_nnode_num(row, col); |
2235 | if (cnode->num != num) { | 2235 | if (cnode->num != num) { |
2236 | dbg_err("nnode num %d expected %d " | 2236 | ubifs_err("nnode num %d expected %d " |
2237 | "parent num %d iip %d", cnode->num, num, | 2237 | "parent num %d iip %d", |
2238 | (nnode ? nnode->num : 0), cnode->iip); | 2238 | cnode->num, num, |
2239 | (nnode ? nnode->num : 0), cnode->iip); | ||
2239 | return -EINVAL; | 2240 | return -EINVAL; |
2240 | } | 2241 | } |
2241 | nn = (struct ubifs_nnode *)cnode; | 2242 | nn = (struct ubifs_nnode *)cnode; |
diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c index 97822db3afbc..862c4ca98b85 100644 --- a/fs/ubifs/lpt_commit.c +++ b/fs/ubifs/lpt_commit.c | |||
@@ -320,9 +320,8 @@ static int layout_cnodes(struct ubifs_info *c) | |||
320 | return 0; | 320 | return 0; |
321 | 321 | ||
322 | no_space: | 322 | no_space: |
323 | ubifs_err("LPT out of space"); | 323 | ubifs_err("LPT out of space at LEB %d:%d needing %d, done_ltab %d, " |
324 | dbg_err("LPT out of space at LEB %d:%d needing %d, done_ltab %d, " | 324 | "done_lsave %d", lnum, offs, len, done_ltab, done_lsave); |
325 | "done_lsave %d", lnum, offs, len, done_ltab, done_lsave); | ||
326 | ubifs_dump_lpt_info(c); | 325 | ubifs_dump_lpt_info(c); |
327 | ubifs_dump_lpt_lebs(c); | 326 | ubifs_dump_lpt_lebs(c); |
328 | dump_stack(); | 327 | dump_stack(); |
@@ -548,9 +547,8 @@ static int write_cnodes(struct ubifs_info *c) | |||
548 | return 0; | 547 | return 0; |
549 | 548 | ||
550 | no_space: | 549 | no_space: |
551 | ubifs_err("LPT out of space mismatch"); | 550 | ubifs_err("LPT out of space mismatch at LEB %d:%d needing %d, done_ltab " |
552 | dbg_err("LPT out of space mismatch at LEB %d:%d needing %d, done_ltab " | 551 | "%d, done_lsave %d", lnum, offs, len, done_ltab, done_lsave); |
553 | "%d, done_lsave %d", lnum, offs, len, done_ltab, done_lsave); | ||
554 | ubifs_dump_lpt_info(c); | 552 | ubifs_dump_lpt_info(c); |
555 | ubifs_dump_lpt_lebs(c); | 553 | ubifs_dump_lpt_lebs(c); |
556 | dump_stack(); | 554 | dump_stack(); |
@@ -1733,7 +1731,7 @@ int dbg_check_ltab(struct ubifs_info *c) | |||
1733 | for (lnum = c->lpt_first; lnum <= c->lpt_last; lnum++) { | 1731 | for (lnum = c->lpt_first; lnum <= c->lpt_last; lnum++) { |
1734 | err = dbg_check_ltab_lnum(c, lnum); | 1732 | err = dbg_check_ltab_lnum(c, lnum); |
1735 | if (err) { | 1733 | if (err) { |
1736 | dbg_err("failed at LEB %d", lnum); | 1734 | ubifs_err("failed at LEB %d", lnum); |
1737 | return err; | 1735 | return err; |
1738 | } | 1736 | } |
1739 | } | 1737 | } |
@@ -1765,8 +1763,8 @@ int dbg_chk_lpt_free_spc(struct ubifs_info *c) | |||
1765 | free += c->leb_size; | 1763 | free += c->leb_size; |
1766 | } | 1764 | } |
1767 | if (free < c->lpt_sz) { | 1765 | if (free < c->lpt_sz) { |
1768 | dbg_err("LPT space error: free %lld lpt_sz %lld", | 1766 | ubifs_err("LPT space error: free %lld lpt_sz %lld", |
1769 | free, c->lpt_sz); | 1767 | free, c->lpt_sz); |
1770 | ubifs_dump_lpt_info(c); | 1768 | ubifs_dump_lpt_info(c); |
1771 | ubifs_dump_lpt_lebs(c); | 1769 | ubifs_dump_lpt_lebs(c); |
1772 | dump_stack(); | 1770 | dump_stack(); |
@@ -1805,13 +1803,13 @@ int dbg_chk_lpt_sz(struct ubifs_info *c, int action, int len) | |||
1805 | d->chk_lpt_lebs = 0; | 1803 | d->chk_lpt_lebs = 0; |
1806 | d->chk_lpt_wastage = 0; | 1804 | d->chk_lpt_wastage = 0; |
1807 | if (c->dirty_pn_cnt > c->pnode_cnt) { | 1805 | if (c->dirty_pn_cnt > c->pnode_cnt) { |
1808 | dbg_err("dirty pnodes %d exceed max %d", | 1806 | ubifs_err("dirty pnodes %d exceed max %d", |
1809 | c->dirty_pn_cnt, c->pnode_cnt); | 1807 | c->dirty_pn_cnt, c->pnode_cnt); |
1810 | err = -EINVAL; | 1808 | err = -EINVAL; |
1811 | } | 1809 | } |
1812 | if (c->dirty_nn_cnt > c->nnode_cnt) { | 1810 | if (c->dirty_nn_cnt > c->nnode_cnt) { |
1813 | dbg_err("dirty nnodes %d exceed max %d", | 1811 | ubifs_err("dirty nnodes %d exceed max %d", |
1814 | c->dirty_nn_cnt, c->nnode_cnt); | 1812 | c->dirty_nn_cnt, c->nnode_cnt); |
1815 | err = -EINVAL; | 1813 | err = -EINVAL; |
1816 | } | 1814 | } |
1817 | return err; | 1815 | return err; |
@@ -1828,23 +1826,23 @@ int dbg_chk_lpt_sz(struct ubifs_info *c, int action, int len) | |||
1828 | chk_lpt_sz *= d->chk_lpt_lebs; | 1826 | chk_lpt_sz *= d->chk_lpt_lebs; |
1829 | chk_lpt_sz += len - c->nhead_offs; | 1827 | chk_lpt_sz += len - c->nhead_offs; |
1830 | if (d->chk_lpt_sz != chk_lpt_sz) { | 1828 | if (d->chk_lpt_sz != chk_lpt_sz) { |
1831 | dbg_err("LPT wrote %lld but space used was %lld", | 1829 | ubifs_err("LPT wrote %lld but space used was %lld", |
1832 | d->chk_lpt_sz, chk_lpt_sz); | 1830 | d->chk_lpt_sz, chk_lpt_sz); |
1833 | err = -EINVAL; | 1831 | err = -EINVAL; |
1834 | } | 1832 | } |
1835 | if (d->chk_lpt_sz > c->lpt_sz) { | 1833 | if (d->chk_lpt_sz > c->lpt_sz) { |
1836 | dbg_err("LPT wrote %lld but lpt_sz is %lld", | 1834 | ubifs_err("LPT wrote %lld but lpt_sz is %lld", |
1837 | d->chk_lpt_sz, c->lpt_sz); | 1835 | d->chk_lpt_sz, c->lpt_sz); |
1838 | err = -EINVAL; | 1836 | err = -EINVAL; |
1839 | } | 1837 | } |
1840 | if (d->chk_lpt_sz2 && d->chk_lpt_sz != d->chk_lpt_sz2) { | 1838 | if (d->chk_lpt_sz2 && d->chk_lpt_sz != d->chk_lpt_sz2) { |
1841 | dbg_err("LPT layout size %lld but wrote %lld", | 1839 | ubifs_err("LPT layout size %lld but wrote %lld", |
1842 | d->chk_lpt_sz, d->chk_lpt_sz2); | 1840 | d->chk_lpt_sz, d->chk_lpt_sz2); |
1843 | err = -EINVAL; | 1841 | err = -EINVAL; |
1844 | } | 1842 | } |
1845 | if (d->chk_lpt_sz2 && d->new_nhead_offs != len) { | 1843 | if (d->chk_lpt_sz2 && d->new_nhead_offs != len) { |
1846 | dbg_err("LPT new nhead offs: expected %d was %d", | 1844 | ubifs_err("LPT new nhead offs: expected %d was %d", |
1847 | d->new_nhead_offs, len); | 1845 | d->new_nhead_offs, len); |
1848 | err = -EINVAL; | 1846 | err = -EINVAL; |
1849 | } | 1847 | } |
1850 | lpt_sz = (long long)c->pnode_cnt * c->pnode_sz; | 1848 | lpt_sz = (long long)c->pnode_cnt * c->pnode_sz; |
@@ -1853,8 +1851,8 @@ int dbg_chk_lpt_sz(struct ubifs_info *c, int action, int len) | |||
1853 | if (c->big_lpt) | 1851 | if (c->big_lpt) |
1854 | lpt_sz += c->lsave_sz; | 1852 | lpt_sz += c->lsave_sz; |
1855 | if (d->chk_lpt_sz - d->chk_lpt_wastage > lpt_sz) { | 1853 | if (d->chk_lpt_sz - d->chk_lpt_wastage > lpt_sz) { |
1856 | dbg_err("LPT chk_lpt_sz %lld + waste %lld exceeds %lld", | 1854 | ubifs_err("LPT chk_lpt_sz %lld + waste %lld exceeds %lld", |
1857 | d->chk_lpt_sz, d->chk_lpt_wastage, lpt_sz); | 1855 | d->chk_lpt_sz, d->chk_lpt_wastage, lpt_sz); |
1858 | err = -EINVAL; | 1856 | err = -EINVAL; |
1859 | } | 1857 | } |
1860 | if (err) { | 1858 | if (err) { |
diff --git a/fs/ubifs/orphan.c b/fs/ubifs/orphan.c index 97ad042e4715..95155cc18084 100644 --- a/fs/ubifs/orphan.c +++ b/fs/ubifs/orphan.c | |||
@@ -88,7 +88,7 @@ int ubifs_add_orphan(struct ubifs_info *c, ino_t inum) | |||
88 | else if (inum > o->inum) | 88 | else if (inum > o->inum) |
89 | p = &(*p)->rb_right; | 89 | p = &(*p)->rb_right; |
90 | else { | 90 | else { |
91 | dbg_err("orphaned twice"); | 91 | ubifs_err("orphaned twice"); |
92 | spin_unlock(&c->orphan_lock); | 92 | spin_unlock(&c->orphan_lock); |
93 | kfree(orphan); | 93 | kfree(orphan); |
94 | return 0; | 94 | return 0; |
@@ -154,7 +154,7 @@ void ubifs_delete_orphan(struct ubifs_info *c, ino_t inum) | |||
154 | } | 154 | } |
155 | } | 155 | } |
156 | spin_unlock(&c->orphan_lock); | 156 | spin_unlock(&c->orphan_lock); |
157 | dbg_err("missing orphan ino %lu", (unsigned long)inum); | 157 | ubifs_err("missing orphan ino %lu", (unsigned long)inum); |
158 | dump_stack(); | 158 | dump_stack(); |
159 | } | 159 | } |
160 | 160 | ||
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index bbeab617960b..01a348dd4587 100644 --- a/fs/ubifs/recovery.c +++ b/fs/ubifs/recovery.c | |||
@@ -362,11 +362,11 @@ out_err: | |||
362 | out_free: | 362 | out_free: |
363 | ubifs_err("failed to recover master node"); | 363 | ubifs_err("failed to recover master node"); |
364 | if (mst1) { | 364 | if (mst1) { |
365 | dbg_err("dumping first master node"); | 365 | ubifs_err("dumping first master node"); |
366 | ubifs_dump_node(c, mst1); | 366 | ubifs_dump_node(c, mst1); |
367 | } | 367 | } |
368 | if (mst2) { | 368 | if (mst2) { |
369 | dbg_err("dumping second master node"); | 369 | ubifs_err("dumping second master node"); |
370 | ubifs_dump_node(c, mst2); | 370 | ubifs_dump_node(c, mst2); |
371 | } | 371 | } |
372 | vfree(buf2); | 372 | vfree(buf2); |
@@ -683,7 +683,7 @@ struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum, | |||
683 | ret, lnum, offs); | 683 | ret, lnum, offs); |
684 | break; | 684 | break; |
685 | } else { | 685 | } else { |
686 | dbg_err("unexpected return value %d", ret); | 686 | ubifs_err("unexpected return value %d", ret); |
687 | err = -EINVAL; | 687 | err = -EINVAL; |
688 | goto error; | 688 | goto error; |
689 | } | 689 | } |
@@ -789,7 +789,7 @@ struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum, | |||
789 | 789 | ||
790 | corrupted_rescan: | 790 | corrupted_rescan: |
791 | /* Re-scan the corrupted data with verbose messages */ | 791 | /* Re-scan the corrupted data with verbose messages */ |
792 | dbg_err("corruptio %d", ret); | 792 | ubifs_err("corruptio %d", ret); |
793 | ubifs_scan_a_node(c, buf, len, lnum, offs, 1); | 793 | ubifs_scan_a_node(c, buf, len, lnum, offs, 1); |
794 | corrupted: | 794 | corrupted: |
795 | ubifs_scanned_corruption(c, lnum, offs, buf); | 795 | ubifs_scanned_corruption(c, lnum, offs, buf); |
@@ -827,17 +827,17 @@ static int get_cs_sqnum(struct ubifs_info *c, int lnum, int offs, | |||
827 | goto out_free; | 827 | goto out_free; |
828 | ret = ubifs_scan_a_node(c, cs_node, UBIFS_CS_NODE_SZ, lnum, offs, 0); | 828 | ret = ubifs_scan_a_node(c, cs_node, UBIFS_CS_NODE_SZ, lnum, offs, 0); |
829 | if (ret != SCANNED_A_NODE) { | 829 | if (ret != SCANNED_A_NODE) { |
830 | dbg_err("Not a valid node"); | 830 | ubifs_err("Not a valid node"); |
831 | goto out_err; | 831 | goto out_err; |
832 | } | 832 | } |
833 | if (cs_node->ch.node_type != UBIFS_CS_NODE) { | 833 | if (cs_node->ch.node_type != UBIFS_CS_NODE) { |
834 | dbg_err("Node a CS node, type is %d", cs_node->ch.node_type); | 834 | ubifs_err("Node a CS node, type is %d", cs_node->ch.node_type); |
835 | goto out_err; | 835 | goto out_err; |
836 | } | 836 | } |
837 | if (le64_to_cpu(cs_node->cmt_no) != c->cmt_no) { | 837 | if (le64_to_cpu(cs_node->cmt_no) != c->cmt_no) { |
838 | dbg_err("CS node cmt_no %llu != current cmt_no %llu", | 838 | ubifs_err("CS node cmt_no %llu != current cmt_no %llu", |
839 | (unsigned long long)le64_to_cpu(cs_node->cmt_no), | 839 | (unsigned long long)le64_to_cpu(cs_node->cmt_no), |
840 | c->cmt_no); | 840 | c->cmt_no); |
841 | goto out_err; | 841 | goto out_err; |
842 | } | 842 | } |
843 | *cs_sqnum = le64_to_cpu(cs_node->ch.sqnum); | 843 | *cs_sqnum = le64_to_cpu(cs_node->ch.sqnum); |
@@ -1138,7 +1138,7 @@ static int grab_empty_leb(struct ubifs_info *c) | |||
1138 | */ | 1138 | */ |
1139 | lnum = ubifs_find_free_leb_for_idx(c); | 1139 | lnum = ubifs_find_free_leb_for_idx(c); |
1140 | if (lnum < 0) { | 1140 | if (lnum < 0) { |
1141 | dbg_err("could not find an empty LEB"); | 1141 | ubifs_err("could not find an empty LEB"); |
1142 | ubifs_dump_lprops(c); | 1142 | ubifs_dump_lprops(c); |
1143 | ubifs_dump_budg(c, &c->bi); | 1143 | ubifs_dump_budg(c, &c->bi); |
1144 | return lnum; | 1144 | return lnum; |
@@ -1218,7 +1218,7 @@ int ubifs_rcvry_gc_commit(struct ubifs_info *c) | |||
1218 | } | 1218 | } |
1219 | mutex_unlock(&wbuf->io_mutex); | 1219 | mutex_unlock(&wbuf->io_mutex); |
1220 | if (err < 0) { | 1220 | if (err < 0) { |
1221 | dbg_err("GC failed, error %d", err); | 1221 | ubifs_err("GC failed, error %d", err); |
1222 | if (err == -EAGAIN) | 1222 | if (err == -EAGAIN) |
1223 | err = -EINVAL; | 1223 | err = -EINVAL; |
1224 | return err; | 1224 | return err; |
diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index 6ce25969b785..2a2e3ee720fe 100644 --- a/fs/ubifs/replay.c +++ b/fs/ubifs/replay.c | |||
@@ -861,16 +861,16 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf) | |||
861 | * numbers. | 861 | * numbers. |
862 | */ | 862 | */ |
863 | if (snod->type != UBIFS_CS_NODE) { | 863 | if (snod->type != UBIFS_CS_NODE) { |
864 | dbg_err("first log node at LEB %d:%d is not CS node", | 864 | ubifs_err("first log node at LEB %d:%d is not CS node", |
865 | lnum, offs); | 865 | lnum, offs); |
866 | goto out_dump; | 866 | goto out_dump; |
867 | } | 867 | } |
868 | if (le64_to_cpu(node->cmt_no) != c->cmt_no) { | 868 | if (le64_to_cpu(node->cmt_no) != c->cmt_no) { |
869 | dbg_err("first CS node at LEB %d:%d has wrong " | 869 | ubifs_err("first CS node at LEB %d:%d has wrong " |
870 | "commit number %llu expected %llu", | 870 | "commit number %llu expected %llu", |
871 | lnum, offs, | 871 | lnum, offs, |
872 | (unsigned long long)le64_to_cpu(node->cmt_no), | 872 | (unsigned long long)le64_to_cpu(node->cmt_no), |
873 | c->cmt_no); | 873 | c->cmt_no); |
874 | goto out_dump; | 874 | goto out_dump; |
875 | } | 875 | } |
876 | 876 | ||
@@ -892,7 +892,7 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf) | |||
892 | 892 | ||
893 | /* Make sure the first node sits at offset zero of the LEB */ | 893 | /* Make sure the first node sits at offset zero of the LEB */ |
894 | if (snod->offs != 0) { | 894 | if (snod->offs != 0) { |
895 | dbg_err("first node is not at zero offset"); | 895 | ubifs_err("first node is not at zero offset"); |
896 | goto out_dump; | 896 | goto out_dump; |
897 | } | 897 | } |
898 | 898 | ||
@@ -905,8 +905,8 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf) | |||
905 | } | 905 | } |
906 | 906 | ||
907 | if (snod->sqnum < c->cs_sqnum) { | 907 | if (snod->sqnum < c->cs_sqnum) { |
908 | dbg_err("bad sqnum %llu, commit sqnum %llu", | 908 | ubifs_err("bad sqnum %llu, commit sqnum %llu", |
909 | snod->sqnum, c->cs_sqnum); | 909 | snod->sqnum, c->cs_sqnum); |
910 | goto out_dump; | 910 | goto out_dump; |
911 | } | 911 | } |
912 | 912 | ||
diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c index ec82a6851032..7c40e6025fd6 100644 --- a/fs/ubifs/scan.c +++ b/fs/ubifs/scan.c | |||
@@ -109,8 +109,8 @@ int ubifs_scan_a_node(const struct ubifs_info *c, void *buf, int len, int lnum, | |||
109 | /* Make the node pads to 8-byte boundary */ | 109 | /* Make the node pads to 8-byte boundary */ |
110 | if ((node_len + pad_len) & 7) { | 110 | if ((node_len + pad_len) & 7) { |
111 | if (!quiet) | 111 | if (!quiet) |
112 | dbg_err("bad padding length %d - %d", | 112 | ubifs_err("bad padding length %d - %d", |
113 | offs, offs + node_len + pad_len); | 113 | offs, offs + node_len + pad_len); |
114 | return SCANNED_A_BAD_PAD_NODE; | 114 | return SCANNED_A_BAD_PAD_NODE; |
115 | } | 115 | } |
116 | 116 | ||
@@ -245,7 +245,7 @@ void ubifs_scanned_corruption(const struct ubifs_info *c, int lnum, int offs, | |||
245 | len = c->leb_size - offs; | 245 | len = c->leb_size - offs; |
246 | if (len > 8192) | 246 | if (len > 8192) |
247 | len = 8192; | 247 | len = 8192; |
248 | dbg_err("first %d bytes from LEB %d:%d", len, lnum, offs); | 248 | ubifs_err("first %d bytes from LEB %d:%d", len, lnum, offs); |
249 | print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 4, buf, len, 1); | 249 | print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 4, buf, len, 1); |
250 | } | 250 | } |
251 | 251 | ||
@@ -300,16 +300,16 @@ struct ubifs_scan_leb *ubifs_scan(const struct ubifs_info *c, int lnum, | |||
300 | 300 | ||
301 | switch (ret) { | 301 | switch (ret) { |
302 | case SCANNED_GARBAGE: | 302 | case SCANNED_GARBAGE: |
303 | dbg_err("garbage"); | 303 | ubifs_err("garbage"); |
304 | goto corrupted; | 304 | goto corrupted; |
305 | case SCANNED_A_NODE: | 305 | case SCANNED_A_NODE: |
306 | break; | 306 | break; |
307 | case SCANNED_A_CORRUPT_NODE: | 307 | case SCANNED_A_CORRUPT_NODE: |
308 | case SCANNED_A_BAD_PAD_NODE: | 308 | case SCANNED_A_BAD_PAD_NODE: |
309 | dbg_err("bad node"); | 309 | ubifs_err("bad node"); |
310 | goto corrupted; | 310 | goto corrupted; |
311 | default: | 311 | default: |
312 | dbg_err("unknown"); | 312 | ubifs_err("unknown"); |
313 | err = -EINVAL; | 313 | err = -EINVAL; |
314 | goto error; | 314 | goto error; |
315 | } | 315 | } |
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 147b7acf4786..5b30c4db0d42 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -668,8 +668,8 @@ static int init_constants_sb(struct ubifs_info *c) | |||
668 | tmp = UBIFS_CS_NODE_SZ + UBIFS_REF_NODE_SZ * c->jhead_cnt; | 668 | tmp = UBIFS_CS_NODE_SZ + UBIFS_REF_NODE_SZ * c->jhead_cnt; |
669 | tmp = ALIGN(tmp, c->min_io_size); | 669 | tmp = ALIGN(tmp, c->min_io_size); |
670 | if (tmp > c->leb_size) { | 670 | if (tmp > c->leb_size) { |
671 | dbg_err("too small LEB size %d, at least %d needed", | 671 | ubifs_err("too small LEB size %d, at least %d needed", |
672 | c->leb_size, tmp); | 672 | c->leb_size, tmp); |
673 | return -EINVAL; | 673 | return -EINVAL; |
674 | } | 674 | } |
675 | 675 | ||
@@ -683,8 +683,8 @@ static int init_constants_sb(struct ubifs_info *c) | |||
683 | tmp /= c->leb_size; | 683 | tmp /= c->leb_size; |
684 | tmp += 1; | 684 | tmp += 1; |
685 | if (c->log_lebs < tmp) { | 685 | if (c->log_lebs < tmp) { |
686 | dbg_err("too small log %d LEBs, required min. %d LEBs", | 686 | ubifs_err("too small log %d LEBs, required min. %d LEBs", |
687 | c->log_lebs, tmp); | 687 | c->log_lebs, tmp); |
688 | return -EINVAL; | 688 | return -EINVAL; |
689 | } | 689 | } |
690 | 690 | ||
@@ -863,7 +863,7 @@ static void free_orphans(struct ubifs_info *c) | |||
863 | orph = list_entry(c->orph_list.next, struct ubifs_orphan, list); | 863 | orph = list_entry(c->orph_list.next, struct ubifs_orphan, list); |
864 | list_del(&orph->list); | 864 | list_del(&orph->list); |
865 | kfree(orph); | 865 | kfree(orph); |
866 | dbg_err("orphan list not empty at unmount"); | 866 | ubifs_err("orphan list not empty at unmount"); |
867 | } | 867 | } |
868 | 868 | ||
869 | vfree(c->orph_buf); | 869 | vfree(c->orph_buf); |
@@ -2126,8 +2126,8 @@ static struct dentry *ubifs_mount(struct file_system_type *fs_type, int flags, | |||
2126 | */ | 2126 | */ |
2127 | ubi = open_ubi(name, UBI_READONLY); | 2127 | ubi = open_ubi(name, UBI_READONLY); |
2128 | if (IS_ERR(ubi)) { | 2128 | if (IS_ERR(ubi)) { |
2129 | dbg_err("cannot open \"%s\", error %d", | 2129 | ubifs_err("cannot open \"%s\", error %d", |
2130 | name, (int)PTR_ERR(ubi)); | 2130 | name, (int)PTR_ERR(ubi)); |
2131 | return ERR_CAST(ubi); | 2131 | return ERR_CAST(ubi); |
2132 | } | 2132 | } |
2133 | 2133 | ||
diff --git a/fs/ubifs/tnc_misc.c b/fs/ubifs/tnc_misc.c index 15212d666b15..d38ac7f9654b 100644 --- a/fs/ubifs/tnc_misc.c +++ b/fs/ubifs/tnc_misc.c | |||
@@ -293,10 +293,10 @@ static int read_znode(struct ubifs_info *c, int lnum, int offs, int len, | |||
293 | lnum, offs, znode->level, znode->child_cnt); | 293 | lnum, offs, znode->level, znode->child_cnt); |
294 | 294 | ||
295 | if (znode->child_cnt > c->fanout || znode->level > UBIFS_MAX_LEVELS) { | 295 | if (znode->child_cnt > c->fanout || znode->level > UBIFS_MAX_LEVELS) { |
296 | dbg_err("current fanout %d, branch count %d", | 296 | ubifs_err("current fanout %d, branch count %d", |
297 | c->fanout, znode->child_cnt); | 297 | c->fanout, znode->child_cnt); |
298 | dbg_err("max levels %d, znode level %d", | 298 | ubifs_err("max levels %d, znode level %d", |
299 | UBIFS_MAX_LEVELS, znode->level); | 299 | UBIFS_MAX_LEVELS, znode->level); |
300 | err = 1; | 300 | err = 1; |
301 | goto out_dump; | 301 | goto out_dump; |
302 | } | 302 | } |
@@ -316,7 +316,7 @@ static int read_znode(struct ubifs_info *c, int lnum, int offs, int len, | |||
316 | if (zbr->lnum < c->main_first || | 316 | if (zbr->lnum < c->main_first || |
317 | zbr->lnum >= c->leb_cnt || zbr->offs < 0 || | 317 | zbr->lnum >= c->leb_cnt || zbr->offs < 0 || |
318 | zbr->offs + zbr->len > c->leb_size || zbr->offs & 7) { | 318 | zbr->offs + zbr->len > c->leb_size || zbr->offs & 7) { |
319 | dbg_err("bad branch %d", i); | 319 | ubifs_err("bad branch %d", i); |
320 | err = 2; | 320 | err = 2; |
321 | goto out_dump; | 321 | goto out_dump; |
322 | } | 322 | } |
@@ -340,19 +340,19 @@ static int read_znode(struct ubifs_info *c, int lnum, int offs, int len, | |||
340 | type = key_type(c, &zbr->key); | 340 | type = key_type(c, &zbr->key); |
341 | if (c->ranges[type].max_len == 0) { | 341 | if (c->ranges[type].max_len == 0) { |
342 | if (zbr->len != c->ranges[type].len) { | 342 | if (zbr->len != c->ranges[type].len) { |
343 | dbg_err("bad target node (type %d) length (%d)", | 343 | ubifs_err("bad target node (type %d) length (%d)", |
344 | type, zbr->len); | 344 | type, zbr->len); |
345 | dbg_err("have to be %d", c->ranges[type].len); | 345 | ubifs_err("have to be %d", c->ranges[type].len); |
346 | err = 4; | 346 | err = 4; |
347 | goto out_dump; | 347 | goto out_dump; |
348 | } | 348 | } |
349 | } else if (zbr->len < c->ranges[type].min_len || | 349 | } else if (zbr->len < c->ranges[type].min_len || |
350 | zbr->len > c->ranges[type].max_len) { | 350 | zbr->len > c->ranges[type].max_len) { |
351 | dbg_err("bad target node (type %d) length (%d)", | 351 | ubifs_err("bad target node (type %d) length (%d)", |
352 | type, zbr->len); | 352 | type, zbr->len); |
353 | dbg_err("have to be in range of %d-%d", | 353 | ubifs_err("have to be in range of %d-%d", |
354 | c->ranges[type].min_len, | 354 | c->ranges[type].min_len, |
355 | c->ranges[type].max_len); | 355 | c->ranges[type].max_len); |
356 | err = 5; | 356 | err = 5; |
357 | goto out_dump; | 357 | goto out_dump; |
358 | } | 358 | } |
@@ -370,13 +370,13 @@ static int read_znode(struct ubifs_info *c, int lnum, int offs, int len, | |||
370 | 370 | ||
371 | cmp = keys_cmp(c, key1, key2); | 371 | cmp = keys_cmp(c, key1, key2); |
372 | if (cmp > 0) { | 372 | if (cmp > 0) { |
373 | dbg_err("bad key order (keys %d and %d)", i, i + 1); | 373 | ubifs_err("bad key order (keys %d and %d)", i, i + 1); |
374 | err = 6; | 374 | err = 6; |
375 | goto out_dump; | 375 | goto out_dump; |
376 | } else if (cmp == 0 && !is_hash_key(c, key1)) { | 376 | } else if (cmp == 0 && !is_hash_key(c, key1)) { |
377 | /* These can only be keys with colliding hash */ | 377 | /* These can only be keys with colliding hash */ |
378 | dbg_err("keys %d and %d are not hashed but equivalent", | 378 | ubifs_err("keys %d and %d are not hashed but equivalent", |
379 | i, i + 1); | 379 | i, i + 1); |
380 | err = 7; | 380 | err = 7; |
381 | goto out_dump; | 381 | goto out_dump; |
382 | } | 382 | } |
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index 85b272268754..fd4ac85c5db3 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c | |||
@@ -399,8 +399,8 @@ ssize_t ubifs_getxattr(struct dentry *dentry, const char *name, void *buf, | |||
399 | if (buf) { | 399 | if (buf) { |
400 | /* If @buf is %NULL we are supposed to return the length */ | 400 | /* If @buf is %NULL we are supposed to return the length */ |
401 | if (ui->data_len > size) { | 401 | if (ui->data_len > size) { |
402 | dbg_err("buffer size %zd, xattr len %d", | 402 | ubifs_err("buffer size %zd, xattr len %d", |
403 | size, ui->data_len); | 403 | size, ui->data_len); |
404 | err = -ERANGE; | 404 | err = -ERANGE; |
405 | goto out_iput; | 405 | goto out_iput; |
406 | } | 406 | } |