Commit 22ceaa8c authored by Sascha Hauer's avatar Sascha Hauer Committed by Richard Weinberger

ubifs: Pass ubifs_zbranch to read_znode()

read_znode() takes len, lnum and offs arguments which the caller all
extracts from the same struct ubifs_zbranch *. When adding authentication
support we would have to add a pointer to a hash to the arguments which
is also part of struct ubifs_zbranch. Pass the ubifs_zbranch * instead
so that we do not have to add another argument.
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 545bc8f6
...@@ -265,9 +265,7 @@ long ubifs_destroy_tnc_subtree(const struct ubifs_info *c, ...@@ -265,9 +265,7 @@ long ubifs_destroy_tnc_subtree(const struct ubifs_info *c,
/** /**
* read_znode - read an indexing node from flash and fill znode. * read_znode - read an indexing node from flash and fill znode.
* @c: UBIFS file-system description object * @c: UBIFS file-system description object
* @lnum: LEB of the indexing node to read * @zzbr: the zbranch describing the node to read
* @offs: node offset
* @len: node length
* @znode: znode to read to * @znode: znode to read to
* *
* This function reads an indexing node from the flash media and fills znode * This function reads an indexing node from the flash media and fills znode
...@@ -276,9 +274,12 @@ long ubifs_destroy_tnc_subtree(const struct ubifs_info *c, ...@@ -276,9 +274,12 @@ long ubifs_destroy_tnc_subtree(const struct ubifs_info *c,
* is wrong with it, this function prints complaint messages and returns * is wrong with it, this function prints complaint messages and returns
* %-EINVAL. * %-EINVAL.
*/ */
static int read_znode(struct ubifs_info *c, int lnum, int offs, int len, static int read_znode(struct ubifs_info *c, struct ubifs_zbranch *zzbr,
struct ubifs_znode *znode) struct ubifs_znode *znode)
{ {
int lnum = zzbr->lnum;
int offs = zzbr->offs;
int len = zzbr->len;
int i, err, type, cmp; int i, err, type, cmp;
struct ubifs_idx_node *idx; struct ubifs_idx_node *idx;
...@@ -425,7 +426,7 @@ struct ubifs_znode *ubifs_load_znode(struct ubifs_info *c, ...@@ -425,7 +426,7 @@ struct ubifs_znode *ubifs_load_znode(struct ubifs_info *c,
if (!znode) if (!znode)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
err = read_znode(c, zbr->lnum, zbr->offs, zbr->len, znode); err = read_znode(c, zbr, znode);
if (err) if (err)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment