diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-06-03 07:03:25 -0400 |
---|---|---|
committer | Artem Bityutskiy <dedekind1@gmail.com> | 2011-07-04 03:54:33 -0400 |
commit | d304820a1f6cdacab691bbcb7faa35ec631c6398 (patch) | |
tree | b958f273673000d68a2dc088298425ae1f32e85f /fs/ubifs/lpt_commit.c | |
parent | 83cef708c606f46a2b527af025acb3d24555f0c4 (diff) |
UBIFS: switch to ubifs_leb_read
Instead of using 'ubi_read()' function directly, used the 'ubifs_leb_read()'
helper function instead. This allows to get rid of several redundant error
messages and make sure that we always have a stack dump on read errors.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/lpt_commit.c')
-rw-r--r-- | fs/ubifs/lpt_commit.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c index f13addf72e89..cddd6bd214f4 100644 --- a/fs/ubifs/lpt_commit.c +++ b/fs/ubifs/lpt_commit.c | |||
@@ -1161,11 +1161,11 @@ static int lpt_gc_lnum(struct ubifs_info *c, int lnum) | |||
1161 | void *buf = c->lpt_buf; | 1161 | void *buf = c->lpt_buf; |
1162 | 1162 | ||
1163 | dbg_lp("LEB %d", lnum); | 1163 | dbg_lp("LEB %d", lnum); |
1164 | err = ubi_read(c->ubi, lnum, buf, 0, c->leb_size); | 1164 | |
1165 | if (err) { | 1165 | err = ubifs_leb_read(c, lnum, buf, 0, c->leb_size, 1); |
1166 | ubifs_err("cannot read LEB %d, error %d", lnum, err); | 1166 | if (err) |
1167 | return err; | 1167 | return err; |
1168 | } | 1168 | |
1169 | while (1) { | 1169 | while (1) { |
1170 | if (!is_a_node(c, buf, len)) { | 1170 | if (!is_a_node(c, buf, len)) { |
1171 | int pad_len; | 1171 | int pad_len; |
@@ -1651,11 +1651,11 @@ static int dbg_check_ltab_lnum(struct ubifs_info *c, int lnum) | |||
1651 | } | 1651 | } |
1652 | 1652 | ||
1653 | dbg_lp("LEB %d", lnum); | 1653 | dbg_lp("LEB %d", lnum); |
1654 | err = ubi_read(c->ubi, lnum, buf, 0, c->leb_size); | 1654 | |
1655 | if (err) { | 1655 | err = ubifs_leb_read(c, lnum, buf, 0, c->leb_size, 1); |
1656 | dbg_msg("ubi_read failed, LEB %d, error %d", lnum, err); | 1656 | if (err) |
1657 | goto out; | 1657 | goto out; |
1658 | } | 1658 | |
1659 | while (1) { | 1659 | while (1) { |
1660 | if (!is_a_node(c, p, len)) { | 1660 | if (!is_a_node(c, p, len)) { |
1661 | int i, pad_len; | 1661 | int i, pad_len; |
@@ -1902,11 +1902,10 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum) | |||
1902 | return; | 1902 | return; |
1903 | } | 1903 | } |
1904 | 1904 | ||
1905 | err = ubi_read(c->ubi, lnum, buf, 0, c->leb_size); | 1905 | err = ubifs_leb_read(c, lnum, buf, 0, c->leb_size, 1); |
1906 | if (err) { | 1906 | if (err) |
1907 | ubifs_err("cannot read LEB %d, error %d", lnum, err); | ||
1908 | goto out; | 1907 | goto out; |
1909 | } | 1908 | |
1910 | while (1) { | 1909 | while (1) { |
1911 | offs = c->leb_size - len; | 1910 | offs = c->leb_size - len; |
1912 | if (!is_a_node(c, p, len)) { | 1911 | if (!is_a_node(c, p, len)) { |