From patchwork Fri Oct 9 03:29:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 528087 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E1CFD140DA7 for ; Fri, 9 Oct 2015 14:32:51 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZkONt-0004Ie-W0; Fri, 09 Oct 2015 03:30:18 +0000 Received: from mail-out.m-online.net ([2001:a60:0:28:0:1:25:1]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZkONr-00036q-NH for linux-mtd@lists.infradead.org; Fri, 09 Oct 2015 03:30:16 +0000 Received: from frontend02.mail.m-online.net (unknown [192.168.8.183]) by mail-out.m-online.net (Postfix) with ESMTP id 3nXFJb63Txz3hhj2; Fri, 9 Oct 2015 05:29:51 +0200 (CEST) Received: from localhost (dynscan2.mnet-online.de [192.168.6.69]) by mail.m-online.net (Postfix) with ESMTP id 3nXFJb5b81zvdWF; Fri, 9 Oct 2015 05:29:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.184]) by localhost (dynscan2.mail.m-online.net [192.168.6.69]) (amavisd-new, port 10024) with ESMTP id f6LeaRvkJw8j; Fri, 9 Oct 2015 05:29:50 +0200 (CEST) X-Auth-Info: VADgbBUHZakDm0VNW3bIyHo2PORMR9aQVi1xj0W9DMA= Received: from mail-internal.denx.de (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA; Fri, 9 Oct 2015 05:29:50 +0200 (CEST) Received: from pollux.denx.de (pollux [192.168.1.1]) by mail-internal.denx.de (Postfix) with ESMTP id 71A6F343309; Fri, 9 Oct 2015 05:29:50 +0200 (CEST) Received: by pollux.denx.de (Postfix, from userid 515) id 4A206F206; Fri, 9 Oct 2015 05:29:50 +0200 (CEST) From: Heiko Schocher To: linux-kernel@vger.kernel.org Subject: [PATCH] UBIFS: rename free variable Date: Fri, 9 Oct 2015 05:29:48 +0200 Message-Id: <1444361388-12288-1-git-send-email-hs@denx.de> X-Mailer: git-send-email 2.1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151008_203016_152471_27DACCA0 X-CRM114-Status: GOOD ( 16.61 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2001:a60:0:28:0:1:25:1 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Weinberger , Heiko Schocher , linux-mtd@lists.infradead.org, Adrian Hunter , Artem Bityutskiy MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org rename free variable into not "free", as "free" prevents ubifs sources compiling under U-Boot. So rename "free" into "ifree", where it is an int. Signed-off-by: Heiko Schocher --- fs/ubifs/lprops.c | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c index a0011aa..74b9499 100644 --- a/fs/ubifs/lprops.c +++ b/fs/ubifs/lprops.c @@ -533,7 +533,7 @@ static int is_lprops_dirty(struct ubifs_info *c, struct ubifs_lprops *lprops) */ const struct ubifs_lprops *ubifs_change_lp(struct ubifs_info *c, const struct ubifs_lprops *lp, - int free, int dirty, int flags, + int ifree, int dirty, int flags, int idx_gc_cnt) { /* @@ -555,7 +555,7 @@ const struct ubifs_lprops *ubifs_change_lp(struct ubifs_info *c, ubifs_assert(!(c->lst.total_free & 7) && !(c->lst.total_dirty & 7)); ubifs_assert(!(c->lst.total_dead & 7) && !(c->lst.total_dark & 7)); ubifs_assert(!(c->lst.total_used & 7)); - ubifs_assert(free == LPROPS_NC || free >= 0); + ubifs_assert(ifree == LPROPS_NC || ifree >= 0); ubifs_assert(dirty == LPROPS_NC || dirty >= 0); if (!is_lprops_dirty(c, lprops)) { @@ -583,17 +583,17 @@ const struct ubifs_lprops *ubifs_change_lp(struct ubifs_info *c, c->lst.total_used -= c->leb_size - old_spc; } - if (free != LPROPS_NC) { - free = ALIGN(free, 8); - c->lst.total_free += free - lprops->free; + if (ifree != LPROPS_NC) { + ifree = ALIGN(ifree, 8); + c->lst.total_free += ifree - lprops->free; /* Increase or decrease empty LEBs counter if needed */ - if (free == c->leb_size) { + if (ifree == c->leb_size) { if (lprops->free != c->leb_size) c->lst.empty_lebs += 1; } else if (lprops->free == c->leb_size) c->lst.empty_lebs -= 1; - lprops->free = free; + lprops->free = ifree; } if (dirty != LPROPS_NC) { @@ -660,7 +660,7 @@ void ubifs_get_lp_stats(struct ubifs_info *c, struct ubifs_lp_stats *lst) * same as in case of 'ubifs_change_lp()'. Returns zero in case of success and * a negative error code in case of failure. */ -int ubifs_change_one_lp(struct ubifs_info *c, int lnum, int free, int dirty, +int ubifs_change_one_lp(struct ubifs_info *c, int lnum, int ifree, int dirty, int flags_set, int flags_clean, int idx_gc_cnt) { int err = 0, flags; @@ -675,7 +675,7 @@ int ubifs_change_one_lp(struct ubifs_info *c, int lnum, int free, int dirty, } flags = (lp->flags | flags_set) & ~flags_clean; - lp = ubifs_change_lp(c, lp, free, dirty, flags, idx_gc_cnt); + lp = ubifs_change_lp(c, lp, ifree, dirty, flags, idx_gc_cnt); if (IS_ERR(lp)) err = PTR_ERR(lp); @@ -699,7 +699,7 @@ out: * This function is the same as 'ubifs_change_one_lp()' but @dirty is added to * current dirty space, not substitutes it. */ -int ubifs_update_one_lp(struct ubifs_info *c, int lnum, int free, int dirty, +int ubifs_update_one_lp(struct ubifs_info *c, int lnum, int ifree, int dirty, int flags_set, int flags_clean) { int err = 0, flags; @@ -714,7 +714,7 @@ int ubifs_update_one_lp(struct ubifs_info *c, int lnum, int free, int dirty, } flags = (lp->flags | flags_set) & ~flags_clean; - lp = ubifs_change_lp(c, lp, free, lp->dirty + dirty, flags, 0); + lp = ubifs_change_lp(c, lp, ifree, lp->dirty + dirty, flags, 0); if (IS_ERR(lp)) err = PTR_ERR(lp); @@ -1032,7 +1032,7 @@ static int scan_check_cb(struct ubifs_info *c, { struct ubifs_scan_leb *sleb; struct ubifs_scan_node *snod; - int cat, lnum = lp->lnum, is_idx = 0, used = 0, free, dirty, ret; + int cat, lnum = lp->lnum, is_idx = 0, used = 0, ifree, dirty, ret; void *buf = NULL; cat = lp->flags & LPROPS_CAT_MASK; @@ -1154,20 +1154,20 @@ static int scan_check_cb(struct ubifs_info *c, } } - free = c->leb_size - sleb->endpt; + ifree = c->leb_size - sleb->endpt; dirty = sleb->endpt - used; - if (free > c->leb_size || free < 0 || dirty > c->leb_size || + if (ifree > c->leb_size || ifree < 0 || dirty > c->leb_size || dirty < 0) { ubifs_err(c, "bad calculated accounting for LEB %d: free %d, dirty %d", - lnum, free, dirty); + lnum, ifree, dirty); goto out_destroy; } if (lp->free + lp->dirty == c->leb_size && - free + dirty == c->leb_size) + ifree + dirty == c->leb_size) if ((is_idx && !(lp->flags & LPROPS_INDEX)) || - (!is_idx && free == c->leb_size) || + (!is_idx && ifree == c->leb_size) || lp->free == c->leb_size) { /* * Empty or freeable LEBs could contain index @@ -1176,12 +1176,12 @@ static int scan_check_cb(struct ubifs_info *c, * the same reason. Or it may simply not have been * unmapped. */ - free = lp->free; + ifree = lp->free; dirty = lp->dirty; is_idx = 0; } - if (is_idx && lp->free + lp->dirty == free + dirty && + if (is_idx && lp->free + lp->dirty == ifree + dirty && lnum != c->ihead_lnum) { /* * After an unclean unmount, an index LEB could have a different @@ -1194,15 +1194,15 @@ static int scan_check_cb(struct ubifs_info *c, * write to the free space at the end of an index LEB - except * by the in-the-gaps method for which it is not a problem. */ - free = lp->free; + ifree = lp->free; dirty = lp->dirty; } - if (lp->free != free || lp->dirty != dirty) + if (lp->free != ifree || lp->dirty != dirty) goto out_print; if (is_idx && !(lp->flags & LPROPS_INDEX)) { - if (free == c->leb_size) + if (ifree == c->leb_size) /* Free but not unmapped LEB, it's fine */ is_idx = 0; else { @@ -1216,19 +1216,19 @@ static int scan_check_cb(struct ubifs_info *c, goto out_print; } - if (free == c->leb_size) + if (ifree == c->leb_size) lst->empty_lebs += 1; if (is_idx) lst->idx_lebs += 1; if (!(lp->flags & LPROPS_INDEX)) - lst->total_used += c->leb_size - free - dirty; - lst->total_free += free; + lst->total_used += c->leb_size - ifree - dirty; + lst->total_free += ifree; lst->total_dirty += dirty; if (!(lp->flags & LPROPS_INDEX)) { - int spc = free + dirty; + int spc = ifree + dirty; if (spc < c->dead_wm) lst->total_dead += spc; @@ -1242,7 +1242,7 @@ static int scan_check_cb(struct ubifs_info *c, out_print: ubifs_err(c, "bad accounting of LEB %d: free %d, dirty %d flags %#x, should be free %d, dirty %d", - lnum, lp->free, lp->dirty, lp->flags, free, dirty); + lnum, lp->free, lp->dirty, lp->flags, ifree, dirty); ubifs_dump_leb(c, lnum); out_destroy: ubifs_scan_destroy(sleb);