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/io.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/io.c')
-rw-r--r-- | fs/ubifs/io.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c index 239899d7bf3f..f58f11bed387 100644 --- a/fs/ubifs/io.c +++ b/fs/ubifs/io.c | |||
@@ -941,13 +941,9 @@ int ubifs_read_node_wbuf(struct ubifs_wbuf *wbuf, void *buf, int type, int len, | |||
941 | 941 | ||
942 | if (rlen > 0) { | 942 | if (rlen > 0) { |
943 | /* Read everything that goes before write-buffer */ | 943 | /* Read everything that goes before write-buffer */ |
944 | err = ubi_read(c->ubi, lnum, buf, offs, rlen); | 944 | err = ubifs_leb_read(c, lnum, buf, offs, rlen, 0); |
945 | if (err && err != -EBADMSG) { | 945 | if (err && err != -EBADMSG) |
946 | ubifs_err("failed to read node %d from LEB %d:%d, " | ||
947 | "error %d", type, lnum, offs, err); | ||
948 | dbg_dump_stack(); | ||
949 | return err; | 946 | return err; |
950 | } | ||
951 | } | 947 | } |
952 | 948 | ||
953 | if (type != ch->node_type) { | 949 | if (type != ch->node_type) { |
@@ -1002,12 +998,9 @@ int ubifs_read_node(const struct ubifs_info *c, void *buf, int type, int len, | |||
1002 | ubifs_assert(!(offs & 7) && offs < c->leb_size); | 998 | ubifs_assert(!(offs & 7) && offs < c->leb_size); |
1003 | ubifs_assert(type >= 0 && type < UBIFS_NODE_TYPES_CNT); | 999 | ubifs_assert(type >= 0 && type < UBIFS_NODE_TYPES_CNT); |
1004 | 1000 | ||
1005 | err = ubi_read(c->ubi, lnum, buf, offs, len); | 1001 | err = ubifs_leb_read(c, lnum, buf, offs, len, 0); |
1006 | if (err && err != -EBADMSG) { | 1002 | if (err && err != -EBADMSG) |
1007 | ubifs_err("cannot read node %d from LEB %d:%d, error %d", | ||
1008 | type, lnum, offs, err); | ||
1009 | return err; | 1003 | return err; |
1010 | } | ||
1011 | 1004 | ||
1012 | if (type != ch->node_type) { | 1005 | if (type != ch->node_type) { |
1013 | ubifs_err("bad node type (%d but expected %d)", | 1006 | ubifs_err("bad node type (%d but expected %d)", |