From: Sascha Hauer <s.hauer@pengutronix.de> To: linux-fsdevel@vger.kernel.org Cc: linux-mtd@lists.infradead.org, Jan Kara <jack@suse.com>, Richard Weinberger <richard@nod.at>, kernel@pengutronix.de, Sascha Hauer <s.hauer@pengutronix.de> Subject: [PATCH 10/11] ubifs: export get_znode Date: Wed, 14 Aug 2019 14:18:33 +0200 [thread overview] Message-ID: <20190814121834.13983-11-s.hauer@pengutronix.de> (raw) In-Reply-To: <20190814121834.13983-1-s.hauer@pengutronix.de> get_znode will be needed by upcoming UBIFS quota support. Rename it to ubifs_get_znode and export it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- fs/ubifs/tnc.c | 32 ++++++++++++++++---------------- fs/ubifs/ubifs.h | 2 ++ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c index e8e7b0e9532e..188fa036e655 100644 --- a/fs/ubifs/tnc.c +++ b/fs/ubifs/tnc.c @@ -571,15 +571,15 @@ static int matches_name(struct ubifs_info *c, struct ubifs_zbranch *zbr, } /** - * get_znode - get a TNC znode that may not be loaded yet. + * ubifs_get_znode - get a TNC znode that may not be loaded yet. * @c: UBIFS file-system description object * @znode: parent znode * @n: znode branch slot number * * This function returns the znode or a negative error code. */ -static struct ubifs_znode *get_znode(struct ubifs_info *c, - struct ubifs_znode *znode, int n) +struct ubifs_znode *ubifs_get_znode(struct ubifs_info *c, + struct ubifs_znode *znode, int n) { struct ubifs_zbranch *zbr; @@ -619,11 +619,11 @@ static int tnc_next(struct ubifs_info *c, struct ubifs_znode **zn, int *n) nn = znode->iip + 1; znode = zp; if (nn < znode->child_cnt) { - znode = get_znode(c, znode, nn); + znode = ubifs_get_znode(c, znode, nn); if (IS_ERR(znode)) return PTR_ERR(znode); while (znode->level != 0) { - znode = get_znode(c, znode, 0); + znode = ubifs_get_znode(c, znode, 0); if (IS_ERR(znode)) return PTR_ERR(znode); } @@ -663,12 +663,12 @@ static int tnc_prev(struct ubifs_info *c, struct ubifs_znode **zn, int *n) nn = znode->iip - 1; znode = zp; if (nn >= 0) { - znode = get_znode(c, znode, nn); + znode = ubifs_get_znode(c, znode, nn); if (IS_ERR(znode)) return PTR_ERR(znode); while (znode->level != 0) { nn = znode->child_cnt - 1; - znode = get_znode(c, znode, nn); + znode = ubifs_get_znode(c, znode, nn); if (IS_ERR(znode)) return PTR_ERR(znode); } @@ -2572,7 +2572,7 @@ static int tnc_delete(struct ubifs_info *c, struct ubifs_znode *znode, int n) while (znode->child_cnt == 1 && znode->level != 0) { zp = znode; zbr = &znode->zbranch[0]; - znode = get_znode(c, znode, 0); + znode = ubifs_get_znode(c, znode, 0); if (IS_ERR(znode)) return PTR_ERR(znode); znode = dirty_cow_znode(c, zbr); @@ -3096,12 +3096,12 @@ static struct ubifs_znode *left_znode(struct ubifs_info *c, return NULL; if (n >= 0) { /* Now go down the rightmost branch to 'level' */ - znode = get_znode(c, znode, n); + znode = ubifs_get_znode(c, znode, n); if (IS_ERR(znode)) return znode; while (znode->level != level) { n = znode->child_cnt - 1; - znode = get_znode(c, znode, n); + znode = ubifs_get_znode(c, znode, n); if (IS_ERR(znode)) return znode; } @@ -3133,11 +3133,11 @@ static struct ubifs_znode *right_znode(struct ubifs_info *c, return NULL; if (n < znode->child_cnt) { /* Now go down the leftmost branch to 'level' */ - znode = get_znode(c, znode, n); + znode = ubifs_get_znode(c, znode, n); if (IS_ERR(znode)) return znode; while (znode->level != level) { - znode = get_znode(c, znode, 0); + znode = ubifs_get_znode(c, znode, 0); if (IS_ERR(znode)) return znode; } @@ -3222,13 +3222,13 @@ static struct ubifs_znode *lookup_znode(struct ubifs_info *c, } if (znode->level == level + 1) break; - znode = get_znode(c, znode, n); + znode = ubifs_get_znode(c, znode, n); if (IS_ERR(znode)) return znode; } /* Check if the child is the one we are looking for */ if (znode->zbranch[n].lnum == lnum && znode->zbranch[n].offs == offs) - return get_znode(c, znode, n); + return ubifs_get_znode(c, znode, n); /* If the key is unique, there is nowhere else to look */ if (!is_hash_key(c, key)) return NULL; @@ -3254,7 +3254,7 @@ static struct ubifs_znode *lookup_znode(struct ubifs_info *c, /* Check it */ if (znode->zbranch[n].lnum == lnum && znode->zbranch[n].offs == offs) - return get_znode(c, znode, n); + return ubifs_get_znode(c, znode, n); /* Stop if the key is less than the one we are looking for */ if (keys_cmp(c, &znode->zbranch[n].key, key) < 0) break; @@ -3276,7 +3276,7 @@ static struct ubifs_znode *lookup_znode(struct ubifs_info *c, /* Check it */ if (znode->zbranch[n].lnum == lnum && znode->zbranch[n].offs == offs) - return get_znode(c, znode, n); + return ubifs_get_znode(c, znode, n); /* Stop if the key is greater than the one we are looking for */ if (keys_cmp(c, &znode->zbranch[n].key, key) > 0) break; diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 3f8a33fca67b..fd9e52749ef7 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -1819,6 +1819,8 @@ int ubifs_find_dirty_idx_leb(struct ubifs_info *c); int ubifs_save_dirty_idx_lnums(struct ubifs_info *c); /* tnc.c */ +struct ubifs_znode *ubifs_get_znode(struct ubifs_info *c, + struct ubifs_znode *znode, int n); int ubifs_lookup_level0(struct ubifs_info *c, const union ubifs_key *key, struct ubifs_znode **zn, int *n); int ubifs_tnc_lookup_nm(struct ubifs_info *c, const union ubifs_key *key, -- 2.20.1
WARNING: multiple messages have this Message-ID (diff)
From: Sascha Hauer <s.hauer@pengutronix.de> To: linux-fsdevel@vger.kernel.org Cc: Richard Weinberger <richard@nod.at>, Sascha Hauer <s.hauer@pengutronix.de>, linux-mtd@lists.infradead.org, kernel@pengutronix.de, Jan Kara <jack@suse.com> Subject: [PATCH 10/11] ubifs: export get_znode Date: Wed, 14 Aug 2019 14:18:33 +0200 [thread overview] Message-ID: <20190814121834.13983-11-s.hauer@pengutronix.de> (raw) In-Reply-To: <20190814121834.13983-1-s.hauer@pengutronix.de> get_znode will be needed by upcoming UBIFS quota support. Rename it to ubifs_get_znode and export it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- fs/ubifs/tnc.c | 32 ++++++++++++++++---------------- fs/ubifs/ubifs.h | 2 ++ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c index e8e7b0e9532e..188fa036e655 100644 --- a/fs/ubifs/tnc.c +++ b/fs/ubifs/tnc.c @@ -571,15 +571,15 @@ static int matches_name(struct ubifs_info *c, struct ubifs_zbranch *zbr, } /** - * get_znode - get a TNC znode that may not be loaded yet. + * ubifs_get_znode - get a TNC znode that may not be loaded yet. * @c: UBIFS file-system description object * @znode: parent znode * @n: znode branch slot number * * This function returns the znode or a negative error code. */ -static struct ubifs_znode *get_znode(struct ubifs_info *c, - struct ubifs_znode *znode, int n) +struct ubifs_znode *ubifs_get_znode(struct ubifs_info *c, + struct ubifs_znode *znode, int n) { struct ubifs_zbranch *zbr; @@ -619,11 +619,11 @@ static int tnc_next(struct ubifs_info *c, struct ubifs_znode **zn, int *n) nn = znode->iip + 1; znode = zp; if (nn < znode->child_cnt) { - znode = get_znode(c, znode, nn); + znode = ubifs_get_znode(c, znode, nn); if (IS_ERR(znode)) return PTR_ERR(znode); while (znode->level != 0) { - znode = get_znode(c, znode, 0); + znode = ubifs_get_znode(c, znode, 0); if (IS_ERR(znode)) return PTR_ERR(znode); } @@ -663,12 +663,12 @@ static int tnc_prev(struct ubifs_info *c, struct ubifs_znode **zn, int *n) nn = znode->iip - 1; znode = zp; if (nn >= 0) { - znode = get_znode(c, znode, nn); + znode = ubifs_get_znode(c, znode, nn); if (IS_ERR(znode)) return PTR_ERR(znode); while (znode->level != 0) { nn = znode->child_cnt - 1; - znode = get_znode(c, znode, nn); + znode = ubifs_get_znode(c, znode, nn); if (IS_ERR(znode)) return PTR_ERR(znode); } @@ -2572,7 +2572,7 @@ static int tnc_delete(struct ubifs_info *c, struct ubifs_znode *znode, int n) while (znode->child_cnt == 1 && znode->level != 0) { zp = znode; zbr = &znode->zbranch[0]; - znode = get_znode(c, znode, 0); + znode = ubifs_get_znode(c, znode, 0); if (IS_ERR(znode)) return PTR_ERR(znode); znode = dirty_cow_znode(c, zbr); @@ -3096,12 +3096,12 @@ static struct ubifs_znode *left_znode(struct ubifs_info *c, return NULL; if (n >= 0) { /* Now go down the rightmost branch to 'level' */ - znode = get_znode(c, znode, n); + znode = ubifs_get_znode(c, znode, n); if (IS_ERR(znode)) return znode; while (znode->level != level) { n = znode->child_cnt - 1; - znode = get_znode(c, znode, n); + znode = ubifs_get_znode(c, znode, n); if (IS_ERR(znode)) return znode; } @@ -3133,11 +3133,11 @@ static struct ubifs_znode *right_znode(struct ubifs_info *c, return NULL; if (n < znode->child_cnt) { /* Now go down the leftmost branch to 'level' */ - znode = get_znode(c, znode, n); + znode = ubifs_get_znode(c, znode, n); if (IS_ERR(znode)) return znode; while (znode->level != level) { - znode = get_znode(c, znode, 0); + znode = ubifs_get_znode(c, znode, 0); if (IS_ERR(znode)) return znode; } @@ -3222,13 +3222,13 @@ static struct ubifs_znode *lookup_znode(struct ubifs_info *c, } if (znode->level == level + 1) break; - znode = get_znode(c, znode, n); + znode = ubifs_get_znode(c, znode, n); if (IS_ERR(znode)) return znode; } /* Check if the child is the one we are looking for */ if (znode->zbranch[n].lnum == lnum && znode->zbranch[n].offs == offs) - return get_znode(c, znode, n); + return ubifs_get_znode(c, znode, n); /* If the key is unique, there is nowhere else to look */ if (!is_hash_key(c, key)) return NULL; @@ -3254,7 +3254,7 @@ static struct ubifs_znode *lookup_znode(struct ubifs_info *c, /* Check it */ if (znode->zbranch[n].lnum == lnum && znode->zbranch[n].offs == offs) - return get_znode(c, znode, n); + return ubifs_get_znode(c, znode, n); /* Stop if the key is less than the one we are looking for */ if (keys_cmp(c, &znode->zbranch[n].key, key) < 0) break; @@ -3276,7 +3276,7 @@ static struct ubifs_znode *lookup_znode(struct ubifs_info *c, /* Check it */ if (znode->zbranch[n].lnum == lnum && znode->zbranch[n].offs == offs) - return get_znode(c, znode, n); + return ubifs_get_znode(c, znode, n); /* Stop if the key is greater than the one we are looking for */ if (keys_cmp(c, &znode->zbranch[n].key, key) > 0) break; diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 3f8a33fca67b..fd9e52749ef7 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -1819,6 +1819,8 @@ int ubifs_find_dirty_idx_leb(struct ubifs_info *c); int ubifs_save_dirty_idx_lnums(struct ubifs_info *c); /* tnc.c */ +struct ubifs_znode *ubifs_get_znode(struct ubifs_info *c, + struct ubifs_znode *znode, int n); int ubifs_lookup_level0(struct ubifs_info *c, const union ubifs_key *key, struct ubifs_znode **zn, int *n); int ubifs_tnc_lookup_nm(struct ubifs_info *c, const union ubifs_key *key, -- 2.20.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2019-08-14 12:18 UTC|newest] Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-08-14 12:18 [PATCH 00/11] Add quota support to UBIFS Sascha Hauer 2019-08-14 12:18 ` Sascha Hauer 2019-08-14 12:18 ` [PATCH 01/11] quota: Make inode optional Sascha Hauer 2019-08-14 12:18 ` Sascha Hauer 2019-08-14 12:18 ` [PATCH 02/11] quota: Only module_put the format when existing Sascha Hauer 2019-08-14 12:18 ` Sascha Hauer 2019-08-15 11:18 ` Jan Kara 2019-08-15 11:18 ` Jan Kara 2019-08-16 11:49 ` Sascha Hauer 2019-08-16 11:49 ` Sascha Hauer 2019-08-14 12:18 ` [PATCH 03/11] fs: move __get_super() out of loop Sascha Hauer 2019-08-14 12:18 ` Sascha Hauer 2019-08-14 23:32 ` Al Viro 2019-08-14 23:32 ` Al Viro 2019-08-14 12:18 ` [PATCH 04/11] fs, quota: introduce wait_super_thawed() to wait until a superblock is thawed Sascha Hauer 2019-08-14 12:18 ` Sascha Hauer 2019-08-14 23:35 ` Al Viro 2019-08-14 23:35 ` Al Viro 2019-08-14 12:18 ` [PATCH 05/11] quota: Allow to pass quotactl a mountpoint Sascha Hauer 2019-08-14 12:18 ` Sascha Hauer 2019-08-14 22:42 ` kbuild test robot 2019-08-14 22:42 ` kbuild test robot 2019-08-14 23:33 ` kbuild test robot 2019-08-14 23:33 ` kbuild test robot 2019-08-14 23:36 ` Al Viro 2019-08-14 23:36 ` Al Viro 2019-08-14 23:39 ` Al Viro 2019-08-14 23:39 ` Al Viro 2019-08-14 23:51 ` Al Viro 2019-08-14 23:51 ` Al Viro 2019-08-15 9:53 ` Jan Kara 2019-08-15 9:53 ` Jan Kara 2019-08-15 7:46 ` Sascha Hauer 2019-08-15 7:46 ` Sascha Hauer 2019-08-14 12:18 ` [PATCH 06/11] ubifs: move checks and preparation into setflags() Sascha Hauer 2019-08-14 12:18 ` Sascha Hauer 2019-08-14 12:18 ` [PATCH 07/11] ubifs: Add support for FS_IOC_FS[SG]ETXATTR ioctls Sascha Hauer 2019-08-14 12:18 ` Sascha Hauer 2019-08-14 14:11 ` Mainz, Roland 2019-08-14 14:11 ` Mainz, Roland 2019-08-15 7:31 ` Sascha Hauer 2019-08-15 7:31 ` Sascha Hauer 2019-08-14 12:18 ` [PATCH 08/11] ubifs: do not ubifs_inode() on potentially NULL pointer Sascha Hauer 2019-08-14 12:18 ` Sascha Hauer 2019-08-14 12:18 ` [PATCH 09/11] ubifs: Add support for project id Sascha Hauer 2019-08-14 12:18 ` Sascha Hauer 2019-08-14 12:18 ` Sascha Hauer [this message] 2019-08-14 12:18 ` [PATCH 10/11] ubifs: export get_znode Sascha Hauer 2019-08-14 12:18 ` [PATCH 11/11] ubifs: Add quota support Sascha Hauer 2019-08-14 12:18 ` Sascha Hauer 2019-08-15 11:17 ` Jan Kara 2019-08-15 11:17 ` Jan Kara
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190814121834.13983-11-s.hauer@pengutronix.de \ --to=s.hauer@pengutronix.de \ --cc=jack@suse.com \ --cc=kernel@pengutronix.de \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-mtd@lists.infradead.org \ --cc=richard@nod.at \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.