aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/tnc.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-06-03 07:03:25 -0400
committerArtem Bityutskiy <dedekind1@gmail.com>2011-07-04 03:54:33 -0400
commitd304820a1f6cdacab691bbcb7faa35ec631c6398 (patch)
treeb958f273673000d68a2dc088298425ae1f32e85f /fs/ubifs/tnc.c
parent83cef708c606f46a2b527af025acb3d24555f0c4 (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/tnc.c')
-rw-r--r--fs/ubifs/tnc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c
index 526b63cd3333..066738647685 100644
--- a/fs/ubifs/tnc.c
+++ b/fs/ubifs/tnc.c
@@ -462,7 +462,7 @@ static int try_read_node(const struct ubifs_info *c, void *buf, int type,
462 462
463 dbg_io("LEB %d:%d, %s, length %d", lnum, offs, dbg_ntype(type), len); 463 dbg_io("LEB %d:%d, %s, length %d", lnum, offs, dbg_ntype(type), len);
464 464
465 err = ubi_read(c->ubi, lnum, buf, offs, len); 465 err = ubifs_leb_read(c, lnum, buf, offs, len, 1);
466 if (err) { 466 if (err) {
467 ubifs_err("cannot read node type %d from LEB %d:%d, error %d", 467 ubifs_err("cannot read node type %d from LEB %d:%d, error %d",
468 type, lnum, offs, err); 468 type, lnum, offs, err);
@@ -1666,7 +1666,7 @@ static int read_wbuf(struct ubifs_wbuf *wbuf, void *buf, int len, int lnum,
1666 if (!overlap) { 1666 if (!overlap) {
1667 /* We may safely unlock the write-buffer and read the data */ 1667 /* We may safely unlock the write-buffer and read the data */
1668 spin_unlock(&wbuf->lock); 1668 spin_unlock(&wbuf->lock);
1669 return ubi_read(c->ubi, lnum, buf, offs, len); 1669 return ubifs_leb_read(c, lnum, buf, offs, len, 0);
1670 } 1670 }
1671 1671
1672 /* Don't read under wbuf */ 1672 /* Don't read under wbuf */
@@ -1680,7 +1680,7 @@ static int read_wbuf(struct ubifs_wbuf *wbuf, void *buf, int len, int lnum,
1680 1680
1681 if (rlen > 0) 1681 if (rlen > 0)
1682 /* Read everything that goes before write-buffer */ 1682 /* Read everything that goes before write-buffer */
1683 return ubi_read(c->ubi, lnum, buf, offs, rlen); 1683 return ubifs_leb_read(c, lnum, buf, offs, rlen, 0);
1684 1684
1685 return 0; 1685 return 0;
1686} 1686}
@@ -1767,7 +1767,7 @@ int ubifs_tnc_bulk_read(struct ubifs_info *c, struct bu_info *bu)
1767 if (wbuf) 1767 if (wbuf)
1768 err = read_wbuf(wbuf, bu->buf, len, lnum, offs); 1768 err = read_wbuf(wbuf, bu->buf, len, lnum, offs);
1769 else 1769 else
1770 err = ubi_read(c->ubi, lnum, bu->buf, offs, len); 1770 err = ubifs_leb_read(c, lnum, bu->buf, offs, len, 0);
1771 1771
1772 /* Check for a race with GC */ 1772 /* Check for a race with GC */
1773 if (maybe_leb_gced(c, lnum, bu->gc_seq)) 1773 if (maybe_leb_gced(c, lnum, bu->gc_seq))