From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93D0CC2D0DB for ; Fri, 24 Jan 2020 13:16:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 657D420718 for ; Fri, 24 Jan 2020 13:16:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="p4SdCjqm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 657D420718 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UXcfyMmXZlv9I48XJ119uVNbnCpt//wvDtBm4aKBQ44=; b=p4SdCjqm/YBCHB Hd+lZu0PcoeswhLXxsjfokQD2l9uSh5m2jIyspe9CC6fXHjAJsqdgjJ0NNzavBJvY2j5VwGZZM4LJ c+LKzQDNH65zyXtDKmeViqvLJZvnpSX/40A5UG+pg3fPJHKiQ0Ah+Y0TWN3GK2DB7LqcI1NFv0EUB mI0HJbI8SqsDUWL2YlP4js5UX+R+tlV7FITVT2S7U77xOx05IwX5sscQLS9j3dHyKO342FUTMOmUK gO2GltkIE2xQcjb5RW0UJ6gb8c+ub9J6FG7jCyjZ41/pqmO5By9mD1Ch98lBdaZ3wEMGUnwXGsdUr S5UDDNNVNzRSeOvCxgOA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iuyoX-0000t8-EG; Fri, 24 Jan 2020 13:15:57 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iuymd-0006SN-Bc for linux-mtd@lists.infradead.org; Fri, 24 Jan 2020 13:14:01 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iuym5-0003aK-Rc; Fri, 24 Jan 2020 14:13:25 +0100 Received: from sha by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1iuym5-0006ZS-4g; Fri, 24 Jan 2020 14:13:25 +0100 From: Sascha Hauer To: linux-fsdevel@vger.kernel.org Subject: [PATCH 7/8] ubifs: export get_znode Date: Fri, 24 Jan 2020 14:13:22 +0100 Message-Id: <20200124131323.23885-8-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124131323.23885-1-s.hauer@pengutronix.de> References: <20200124131323.23885-1-s.hauer@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mtd@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200124_051359_713879_1807E8A5 X-CRM114-Status: GOOD ( 14.18 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Weinberger , Sascha Hauer , linux-mtd@lists.infradead.org, kernel@pengutronix.de, Jan Kara Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org get_znode will be needed by upcoming UBIFS quota support. Rename it to ubifs_get_znode and export it. Signed-off-by: Sascha Hauer --- 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 16e140420f35..66c7ed0dc610 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.25.0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/