Skip to content

Commit 22ceaa8

Browse files
saschahauerrichardweinberger
authored andcommitted
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: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 545bc8f commit 22ceaa8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

fs/ubifs/tnc_misc.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,7 @@ long ubifs_destroy_tnc_subtree(const struct ubifs_info *c,
265265
/**
266266
* read_znode - read an indexing node from flash and fill znode.
267267
* @c: UBIFS file-system description object
268-
* @lnum: LEB of the indexing node to read
269-
* @offs: node offset
270-
* @len: node length
268+
* @zzbr: the zbranch describing the node to read
271269
* @znode: znode to read to
272270
*
273271
* 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,
276274
* is wrong with it, this function prints complaint messages and returns
277275
* %-EINVAL.
278276
*/
279-
static int read_znode(struct ubifs_info *c, int lnum, int offs, int len,
277+
static int read_znode(struct ubifs_info *c, struct ubifs_zbranch *zzbr,
280278
struct ubifs_znode *znode)
281279
{
280+
int lnum = zzbr->lnum;
281+
int offs = zzbr->offs;
282+
int len = zzbr->len;
282283
int i, err, type, cmp;
283284
struct ubifs_idx_node *idx;
284285

@@ -425,7 +426,7 @@ struct ubifs_znode *ubifs_load_znode(struct ubifs_info *c,
425426
if (!znode)
426427
return ERR_PTR(-ENOMEM);
427428

428-
err = read_znode(c, zbr->lnum, zbr->offs, zbr->len, znode);
429+
err = read_znode(c, zbr, znode);
429430
if (err)
430431
goto out;
431432

0 commit comments

Comments
 (0)