linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@sandeen.net, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org, bfoster@redhat.com
Subject: [PATCH 02/12] xfs_repair: rename the agfl index loop variable in build_agf_agfl
Date: Mon, 01 Jun 2020 21:27:05 -0700	[thread overview]
Message-ID: <159107202579.315004.8068578556584944834.stgit@magnolia> (raw)
In-Reply-To: <159107201290.315004.4447998785149331259.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

The variable 'i' is used to index the AGFL block list, so change the
name to make it clearer what this is to be used for.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 repair/phase5.c |   28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)


diff --git a/repair/phase5.c b/repair/phase5.c
index c9b278bd..169a2d89 100644
--- a/repair/phase5.c
+++ b/repair/phase5.c
@@ -2055,7 +2055,7 @@ build_agf_agfl(
 {
 	struct extent_tree_node	*ext_ptr;
 	struct xfs_buf		*agf_buf, *agfl_buf;
-	int			i;
+	unsigned int		agfl_idx;
 	struct xfs_agfl		*agfl;
 	struct xfs_agf		*agf;
 	xfs_fsblock_t		fsb;
@@ -2153,8 +2153,8 @@ build_agf_agfl(
 		agfl->agfl_magicnum = cpu_to_be32(XFS_AGFL_MAGIC);
 		agfl->agfl_seqno = cpu_to_be32(agno);
 		platform_uuid_copy(&agfl->agfl_uuid, &mp->m_sb.sb_meta_uuid);
-		for (i = 0; i < libxfs_agfl_size(mp); i++)
-			freelist[i] = cpu_to_be32(NULLAGBLOCK);
+		for (agfl_idx = 0; agfl_idx < libxfs_agfl_size(mp); agfl_idx++)
+			freelist[agfl_idx] = cpu_to_be32(NULLAGBLOCK);
 	}
 
 	/*
@@ -2165,19 +2165,21 @@ build_agf_agfl(
 		/*
 		 * yes, now grab as many blocks as we can
 		 */
-		i = 0;
-		while (bno_bt->num_free_blocks > 0 && i < libxfs_agfl_size(mp))
+		agfl_idx = 0;
+		while (bno_bt->num_free_blocks > 0 &&
+		       agfl_idx < libxfs_agfl_size(mp))
 		{
-			freelist[i] = cpu_to_be32(
+			freelist[agfl_idx] = cpu_to_be32(
 					get_next_blockaddr(agno, 0, bno_bt));
-			i++;
+			agfl_idx++;
 		}
 
-		while (bcnt_bt->num_free_blocks > 0 && i < libxfs_agfl_size(mp))
+		while (bcnt_bt->num_free_blocks > 0 &&
+		       agfl_idx < libxfs_agfl_size(mp))
 		{
-			freelist[i] = cpu_to_be32(
+			freelist[agfl_idx] = cpu_to_be32(
 					get_next_blockaddr(agno, 0, bcnt_bt));
-			i++;
+			agfl_idx++;
 		}
 		/*
 		 * now throw the rest of the blocks away and complain
@@ -2200,9 +2202,9 @@ _("Insufficient memory saving lost blocks.\n"));
 		}
 
 		agf->agf_flfirst = 0;
-		agf->agf_fllast = cpu_to_be32(i - 1);
-		agf->agf_flcount = cpu_to_be32(i);
-		rmap_store_agflcount(mp, agno, i);
+		agf->agf_fllast = cpu_to_be32(agfl_idx - 1);
+		agf->agf_flcount = cpu_to_be32(agfl_idx);
+		rmap_store_agflcount(mp, agno, agfl_idx);
 
 #ifdef XR_BLD_FREE_TRACE
 		fprintf(stderr, "writing agfl for ag %u\n", agno);


  parent reply	other threads:[~2020-06-02  4:29 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02  4:26 [PATCH v6 00/12] xfs_repair: use btree bulk loading Darrick J. Wong
2020-06-02  4:26 ` [PATCH 01/12] xfs_repair: drop lostblocks from build_agf_agfl Darrick J. Wong
2020-06-17 12:09   ` Brian Foster
2020-06-02  4:27 ` Darrick J. Wong [this message]
2020-06-17 12:09   ` [PATCH 02/12] xfs_repair: rename the agfl index loop variable in build_agf_agfl Brian Foster
2020-06-02  4:27 ` [PATCH 03/12] xfs_repair: make container for btree bulkload root and block reservation Darrick J. Wong
2020-06-17 12:09   ` Brian Foster
2020-06-02  4:27 ` [PATCH 04/12] xfs_repair: remove gratuitous code block in phase5 Darrick J. Wong
2020-06-02  4:27 ` [PATCH 05/12] xfs_repair: inject lost blocks back into the fs no matter the owner Darrick J. Wong
2020-06-17 12:09   ` Brian Foster
2020-06-02  4:27 ` [PATCH 06/12] xfs_repair: create a new class of btree rebuild cursors Darrick J. Wong
2020-06-17 12:10   ` Brian Foster
2020-06-18 18:30     ` Darrick J. Wong
2020-06-29 23:10     ` Darrick J. Wong
2020-07-02 15:18   ` [PATCH v2 " Darrick J. Wong
2020-07-03  3:24     ` Eric Sandeen
2020-07-03 20:26       ` Darrick J. Wong
2020-07-03 21:51         ` Eric Sandeen
2020-07-04  3:39           ` Darrick J. Wong
2020-07-10 19:10     ` Eric Sandeen
2020-07-13 13:37       ` Brian Foster
2020-06-02  4:27 ` [PATCH 07/12] xfs_repair: rebuild free space btrees with bulk loader Darrick J. Wong
2020-06-18 15:23   ` Brian Foster
2020-06-18 16:41     ` Darrick J. Wong
2020-06-18 16:51       ` Brian Foster
2020-06-02  4:27 ` [PATCH 08/12] xfs_repair: rebuild inode " Darrick J. Wong
2020-06-18 15:24   ` Brian Foster
2020-06-18 18:33     ` Darrick J. Wong
2020-06-02  4:27 ` [PATCH 09/12] xfs_repair: rebuild reverse mapping " Darrick J. Wong
2020-06-18 15:25   ` Brian Foster
2020-06-18 15:31     ` Darrick J. Wong
2020-06-18 15:37       ` Brian Foster
2020-06-18 16:54         ` Darrick J. Wong
2020-06-02  4:27 ` [PATCH 10/12] xfs_repair: rebuild refcount " Darrick J. Wong
2020-06-18 15:26   ` Brian Foster
2020-06-18 16:56     ` Darrick J. Wong
2020-06-18 17:05       ` Brian Foster
2020-06-02  4:28 ` [PATCH 11/12] xfs_repair: remove old btree rebuild support code Darrick J. Wong
2020-06-19 11:10   ` Brian Foster
2020-06-02  4:28 ` [PATCH 12/12] xfs_repair: use bitmap to track blocks lost during btree construction Darrick J. Wong
2020-06-19 11:10   ` Brian Foster
2020-06-19 21:36     ` Darrick J. Wong

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=159107202579.315004.8068578556584944834.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=bfoster@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).