mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
83cef708c6
commit
d304820a1f
8 changed files with 40 additions and 47 deletions
|
@ -1161,11 +1161,11 @@ static int lpt_gc_lnum(struct ubifs_info *c, int lnum)
|
|||
void *buf = c->lpt_buf;
|
||||
|
||||
dbg_lp("LEB %d", lnum);
|
||||
err = ubi_read(c->ubi, lnum, buf, 0, c->leb_size);
|
||||
if (err) {
|
||||
ubifs_err("cannot read LEB %d, error %d", lnum, err);
|
||||
|
||||
err = ubifs_leb_read(c, lnum, buf, 0, c->leb_size, 1);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
if (!is_a_node(c, buf, len)) {
|
||||
int pad_len;
|
||||
|
@ -1651,11 +1651,11 @@ static int dbg_check_ltab_lnum(struct ubifs_info *c, int lnum)
|
|||
}
|
||||
|
||||
dbg_lp("LEB %d", lnum);
|
||||
err = ubi_read(c->ubi, lnum, buf, 0, c->leb_size);
|
||||
if (err) {
|
||||
dbg_msg("ubi_read failed, LEB %d, error %d", lnum, err);
|
||||
|
||||
err = ubifs_leb_read(c, lnum, buf, 0, c->leb_size, 1);
|
||||
if (err)
|
||||
goto out;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
if (!is_a_node(c, p, len)) {
|
||||
int i, pad_len;
|
||||
|
@ -1902,11 +1902,10 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum)
|
|||
return;
|
||||
}
|
||||
|
||||
err = ubi_read(c->ubi, lnum, buf, 0, c->leb_size);
|
||||
if (err) {
|
||||
ubifs_err("cannot read LEB %d, error %d", lnum, err);
|
||||
err = ubifs_leb_read(c, lnum, buf, 0, c->leb_size, 1);
|
||||
if (err)
|
||||
goto out;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
offs = c->leb_size - len;
|
||||
if (!is_a_node(c, p, len)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue