All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] xfs: make btree cursor private unions anonymous
@ 2020-03-12  3:44 Darrick J. Wong
  2020-03-12  3:44 ` [PATCH 1/7] xfs: introduce new private btree cursor names Darrick J. Wong
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Darrick J. Wong @ 2020-03-12  3:44 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, david

Hi all,

Dave injured his finger and is having difficulty typing, so I fixed a few
things that I didn't like about the v1 patchset and am sending it back out
ahead of resending the btree bulk loading patchset.  The changes are pretty
mechanical and I was gonna apply them, but one more round never hurt anyone.

>From Dave's original cover letter:

"This is a "make things less verbose" cleanup from looking at the
changes Darrick is making to add a staging/fake cursor to the union
for bulk btree loading.

"The process is to create a @defines of the new name to the existing
union name, then replace all users of each union via a script. Then
the union is made anonymous and the members renamed to match the new
code. Then the #defines get removed.

"We do this for the bc_private union, then we name the ag and btree
structures and make them use anonymous unions internally via the
same process.

"That means we go from doubly nested private stuff like this:

"cur->bc_private.a.priv.abt.active

"To the much cleaner, less verbose and more readable:

"cur->bc_ag.abt.active

"Simples, yes?

"[The original] series can be found at:

"https://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git/h?xfs-btree-cursor-cleanup

"Note: the code changes are all scripted, I have not done any
followup to do things like aggregate split lines back into single
lines as that is out of scope of the structure definition cleanup
I'm trying to acheive here. That can be done in future as we modify
the code that now has lines that can be merged....

"Signed-off-by: Dave Chinner <dchinner@redhat.com>"

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This has been lightly tested with fstests.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=btree-private-unions

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 1/7] xfs: introduce new private btree cursor names
  2020-03-12  3:44 [PATCH v2 0/7] xfs: make btree cursor private unions anonymous Darrick J. Wong
@ 2020-03-12  3:44 ` Darrick J. Wong
  2020-03-12 10:41   ` Brian Foster
  2020-03-12  3:44 ` [PATCH 2/7] xfs: convert btree cursor ag-private member name Darrick J. Wong
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 17+ messages in thread
From: Darrick J. Wong @ 2020-03-12  3:44 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, david, Dave Chinner

From: Dave Chinner <dchinner@redhat.com>

Just the defines of the new names - the conversion will be in
scripted commits after this.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[darrick: change "bc_bt" to "bc_ino"]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_btree.h |    2 ++
 1 file changed, 2 insertions(+)


diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
index 3eff7c321d43..4a1c98bdfaad 100644
--- a/fs/xfs/libxfs/xfs_btree.h
+++ b/fs/xfs/libxfs/xfs_btree.h
@@ -224,6 +224,8 @@ typedef struct xfs_btree_cur
 #define	XFS_BTCUR_BPRV_INVALID_OWNER	(1<<1)		/* for ext swap */
 		} b;
 	}		bc_private;	/* per-btree type data */
+#define bc_ag	bc_private.a
+#define bc_ino	bc_private.b
 } xfs_btree_cur_t;
 
 /* cursor flags */


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 2/7] xfs: convert btree cursor ag-private member name
  2020-03-12  3:44 [PATCH v2 0/7] xfs: make btree cursor private unions anonymous Darrick J. Wong
  2020-03-12  3:44 ` [PATCH 1/7] xfs: introduce new private btree cursor names Darrick J. Wong
@ 2020-03-12  3:44 ` Darrick J. Wong
  2020-03-12 10:42   ` Brian Foster
  2020-03-12  3:45 ` [PATCH 3/7] xfs: convert btree cursor inode-private member names Darrick J. Wong
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 17+ messages in thread
From: Darrick J. Wong @ 2020-03-12  3:44 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, david, Dave Chinner

From: Dave Chinner <dchinner@redhat.com>

bc_private.a -> bc_ag conversion via script:

`sed -i 's/bc_private\.a/bc_ag/g' fs/xfs/*[ch] fs/xfs/*/*[ch]`

And then revert the change to the bc_ag #define in
fs/xfs/libxfs/xfs_btree.h manually.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_alloc.c          |   16 +++--
 fs/xfs/libxfs/xfs_alloc_btree.c    |   24 ++++----
 fs/xfs/libxfs/xfs_btree.c          |   12 ++--
 fs/xfs/libxfs/xfs_ialloc.c         |    2 -
 fs/xfs/libxfs/xfs_ialloc_btree.c   |   20 +++----
 fs/xfs/libxfs/xfs_refcount.c       |  110 ++++++++++++++++++------------------
 fs/xfs/libxfs/xfs_refcount_btree.c |   28 +++++----
 fs/xfs/libxfs/xfs_rmap.c           |  110 ++++++++++++++++++------------------
 fs/xfs/libxfs/xfs_rmap_btree.c     |   28 +++++----
 fs/xfs/scrub/agheader_repair.c     |    2 -
 fs/xfs/scrub/alloc.c               |    2 -
 fs/xfs/scrub/bmap.c                |    2 -
 fs/xfs/scrub/ialloc.c              |    8 +--
 fs/xfs/scrub/refcount.c            |    2 -
 fs/xfs/scrub/rmap.c                |    2 -
 fs/xfs/scrub/trace.c               |    2 -
 fs/xfs/xfs_fsmap.c                 |    4 +
 17 files changed, 187 insertions(+), 187 deletions(-)


diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index 5bc58b72a16f..10ed68dfef5d 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -151,7 +151,7 @@ xfs_alloc_lookup_eq(
 	cur->bc_rec.a.ar_startblock = bno;
 	cur->bc_rec.a.ar_blockcount = len;
 	error = xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat);
-	cur->bc_private.a.priv.abt.active = (*stat == 1);
+	cur->bc_ag.priv.abt.active = (*stat == 1);
 	return error;
 }
 
@@ -171,7 +171,7 @@ xfs_alloc_lookup_ge(
 	cur->bc_rec.a.ar_startblock = bno;
 	cur->bc_rec.a.ar_blockcount = len;
 	error = xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat);
-	cur->bc_private.a.priv.abt.active = (*stat == 1);
+	cur->bc_ag.priv.abt.active = (*stat == 1);
 	return error;
 }
 
@@ -190,7 +190,7 @@ xfs_alloc_lookup_le(
 	cur->bc_rec.a.ar_startblock = bno;
 	cur->bc_rec.a.ar_blockcount = len;
 	error = xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat);
-	cur->bc_private.a.priv.abt.active = (*stat == 1);
+	cur->bc_ag.priv.abt.active = (*stat == 1);
 	return error;
 }
 
@@ -198,7 +198,7 @@ static inline bool
 xfs_alloc_cur_active(
 	struct xfs_btree_cur	*cur)
 {
-	return cur && cur->bc_private.a.priv.abt.active;
+	return cur && cur->bc_ag.priv.abt.active;
 }
 
 /*
@@ -230,7 +230,7 @@ xfs_alloc_get_rec(
 	int			*stat)	/* output: success/failure */
 {
 	struct xfs_mount	*mp = cur->bc_mp;
-	xfs_agnumber_t		agno = cur->bc_private.a.agno;
+	xfs_agnumber_t		agno = cur->bc_ag.agno;
 	union xfs_btree_rec	*rec;
 	int			error;
 
@@ -908,7 +908,7 @@ xfs_alloc_cur_check(
 		deactivate = true;
 out:
 	if (deactivate)
-		cur->bc_private.a.priv.abt.active = false;
+		cur->bc_ag.priv.abt.active = false;
 	trace_xfs_alloc_cur_check(args->mp, cur->bc_btnum, bno, len, diff,
 				  *new);
 	return 0;
@@ -1352,7 +1352,7 @@ xfs_alloc_walk_iter(
 		if (error)
 			return error;
 		if (i == 0)
-			cur->bc_private.a.priv.abt.active = false;
+			cur->bc_ag.priv.abt.active = false;
 
 		if (count > 0)
 			count--;
@@ -1467,7 +1467,7 @@ xfs_alloc_ag_vextent_locality(
 		if (error)
 			return error;
 		if (i) {
-			acur->cnt->bc_private.a.priv.abt.active = true;
+			acur->cnt->bc_ag.priv.abt.active = true;
 			fbcur = acur->cnt;
 			fbinc = false;
 		}
diff --git a/fs/xfs/libxfs/xfs_alloc_btree.c b/fs/xfs/libxfs/xfs_alloc_btree.c
index b1b3dc1b0b89..92d30c19519d 100644
--- a/fs/xfs/libxfs/xfs_alloc_btree.c
+++ b/fs/xfs/libxfs/xfs_alloc_btree.c
@@ -25,7 +25,7 @@ xfs_allocbt_dup_cursor(
 	struct xfs_btree_cur	*cur)
 {
 	return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp,
-			cur->bc_private.a.agbp, cur->bc_private.a.agno,
+			cur->bc_ag.agbp, cur->bc_ag.agno,
 			cur->bc_btnum);
 }
 
@@ -35,7 +35,7 @@ xfs_allocbt_set_root(
 	union xfs_btree_ptr	*ptr,
 	int			inc)
 {
-	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
+	struct xfs_buf		*agbp = cur->bc_ag.agbp;
 	struct xfs_agf		*agf = agbp->b_addr;
 	xfs_agnumber_t		seqno = be32_to_cpu(agf->agf_seqno);
 	int			btnum = cur->bc_btnum;
@@ -62,7 +62,7 @@ xfs_allocbt_alloc_block(
 	xfs_agblock_t		bno;
 
 	/* Allocate the new block from the freelist. If we can't, give up.  */
-	error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_private.a.agbp,
+	error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_ag.agbp,
 				       &bno, 1);
 	if (error)
 		return error;
@@ -72,7 +72,7 @@ xfs_allocbt_alloc_block(
 		return 0;
 	}
 
-	xfs_extent_busy_reuse(cur->bc_mp, cur->bc_private.a.agno, bno, 1, false);
+	xfs_extent_busy_reuse(cur->bc_mp, cur->bc_ag.agno, bno, 1, false);
 
 	xfs_trans_agbtree_delta(cur->bc_tp, 1);
 	new->s = cpu_to_be32(bno);
@@ -86,7 +86,7 @@ xfs_allocbt_free_block(
 	struct xfs_btree_cur	*cur,
 	struct xfs_buf		*bp)
 {
-	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
+	struct xfs_buf		*agbp = cur->bc_ag.agbp;
 	struct xfs_agf		*agf = agbp->b_addr;
 	xfs_agblock_t		bno;
 	int			error;
@@ -113,7 +113,7 @@ xfs_allocbt_update_lastrec(
 	int			ptr,
 	int			reason)
 {
-	struct xfs_agf		*agf = cur->bc_private.a.agbp->b_addr;
+	struct xfs_agf		*agf = cur->bc_ag.agbp->b_addr;
 	xfs_agnumber_t		seqno = be32_to_cpu(agf->agf_seqno);
 	struct xfs_perag	*pag;
 	__be32			len;
@@ -162,7 +162,7 @@ xfs_allocbt_update_lastrec(
 	pag = xfs_perag_get(cur->bc_mp, seqno);
 	pag->pagf_longest = be32_to_cpu(len);
 	xfs_perag_put(pag);
-	xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, XFS_AGF_LONGEST);
+	xfs_alloc_log_agf(cur->bc_tp, cur->bc_ag.agbp, XFS_AGF_LONGEST);
 }
 
 STATIC int
@@ -226,9 +226,9 @@ xfs_allocbt_init_ptr_from_cur(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_ptr	*ptr)
 {
-	struct xfs_agf		*agf = cur->bc_private.a.agbp->b_addr;
+	struct xfs_agf		*agf = cur->bc_ag.agbp->b_addr;
 
-	ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno));
+	ASSERT(cur->bc_ag.agno == be32_to_cpu(agf->agf_seqno));
 
 	ptr->s = agf->agf_roots[cur->bc_btnum];
 }
@@ -505,9 +505,9 @@ xfs_allocbt_init_cursor(
 		cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]);
 	}
 
-	cur->bc_private.a.agbp = agbp;
-	cur->bc_private.a.agno = agno;
-	cur->bc_private.a.priv.abt.active = false;
+	cur->bc_ag.agbp = agbp;
+	cur->bc_ag.agno = agno;
+	cur->bc_ag.priv.abt.active = false;
 
 	if (xfs_sb_version_hascrc(&mp->m_sb))
 		cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
index 0599a3ee7d88..7681d48a2b13 100644
--- a/fs/xfs/libxfs/xfs_btree.c
+++ b/fs/xfs/libxfs/xfs_btree.c
@@ -214,7 +214,7 @@ xfs_btree_check_sptr(
 {
 	if (level <= 0)
 		return false;
-	return xfs_verify_agbno(cur->bc_mp, cur->bc_private.a.agno, agbno);
+	return xfs_verify_agbno(cur->bc_mp, cur->bc_ag.agno, agbno);
 }
 
 /*
@@ -243,7 +243,7 @@ xfs_btree_check_ptr(
 			return 0;
 		xfs_err(cur->bc_mp,
 "AG %u: Corrupt btree %d pointer at level %d index %d.",
-				cur->bc_private.a.agno, cur->bc_btnum,
+				cur->bc_ag.agno, cur->bc_btnum,
 				level, index);
 	}
 
@@ -881,13 +881,13 @@ xfs_btree_readahead_sblock(
 
 
 	if ((lr & XFS_BTCUR_LEFTRA) && left != NULLAGBLOCK) {
-		xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno,
+		xfs_btree_reada_bufs(cur->bc_mp, cur->bc_ag.agno,
 				     left, 1, cur->bc_ops->buf_ops);
 		rval++;
 	}
 
 	if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLAGBLOCK) {
-		xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno,
+		xfs_btree_reada_bufs(cur->bc_mp, cur->bc_ag.agno,
 				     right, 1, cur->bc_ops->buf_ops);
 		rval++;
 	}
@@ -945,7 +945,7 @@ xfs_btree_ptr_to_daddr(
 		*daddr = XFS_FSB_TO_DADDR(cur->bc_mp, fsbno);
 	} else {
 		agbno = be32_to_cpu(ptr->s);
-		*daddr = XFS_AGB_TO_DADDR(cur->bc_mp, cur->bc_private.a.agno,
+		*daddr = XFS_AGB_TO_DADDR(cur->bc_mp, cur->bc_ag.agno,
 				agbno);
 	}
 
@@ -1146,7 +1146,7 @@ xfs_btree_init_block_cur(
 	if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
 		owner = cur->bc_private.b.ip->i_ino;
 	else
-		owner = cur->bc_private.a.agno;
+		owner = cur->bc_ag.agno;
 
 	xfs_btree_init_block_int(cur->bc_mp, XFS_BUF_TO_BLOCK(bp), bp->b_bn,
 				 cur->bc_btnum, level, numrecs,
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index b4a404278935..21ac3fb52f4e 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -105,7 +105,7 @@ xfs_inobt_get_rec(
 	int				*stat)
 {
 	struct xfs_mount		*mp = cur->bc_mp;
-	xfs_agnumber_t			agno = cur->bc_private.a.agno;
+	xfs_agnumber_t			agno = cur->bc_ag.agno;
 	union xfs_btree_rec		*rec;
 	int				error;
 	uint64_t			realfree;
diff --git a/fs/xfs/libxfs/xfs_ialloc_btree.c b/fs/xfs/libxfs/xfs_ialloc_btree.c
index 6903820f1c4b..e0e8570af023 100644
--- a/fs/xfs/libxfs/xfs_ialloc_btree.c
+++ b/fs/xfs/libxfs/xfs_ialloc_btree.c
@@ -34,7 +34,7 @@ xfs_inobt_dup_cursor(
 	struct xfs_btree_cur	*cur)
 {
 	return xfs_inobt_init_cursor(cur->bc_mp, cur->bc_tp,
-			cur->bc_private.a.agbp, cur->bc_private.a.agno,
+			cur->bc_ag.agbp, cur->bc_ag.agno,
 			cur->bc_btnum);
 }
 
@@ -44,7 +44,7 @@ xfs_inobt_set_root(
 	union xfs_btree_ptr	*nptr,
 	int			inc)	/* level change */
 {
-	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
+	struct xfs_buf		*agbp = cur->bc_ag.agbp;
 	struct xfs_agi		*agi = agbp->b_addr;
 
 	agi->agi_root = nptr->s;
@@ -58,7 +58,7 @@ xfs_finobt_set_root(
 	union xfs_btree_ptr	*nptr,
 	int			inc)	/* level change */
 {
-	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
+	struct xfs_buf		*agbp = cur->bc_ag.agbp;
 	struct xfs_agi		*agi = agbp->b_addr;
 
 	agi->agi_free_root = nptr->s;
@@ -83,7 +83,7 @@ __xfs_inobt_alloc_block(
 	args.tp = cur->bc_tp;
 	args.mp = cur->bc_mp;
 	args.oinfo = XFS_RMAP_OINFO_INOBT;
-	args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_private.a.agno, sbno);
+	args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_ag.agno, sbno);
 	args.minlen = 1;
 	args.maxlen = 1;
 	args.prod = 1;
@@ -212,9 +212,9 @@ xfs_inobt_init_ptr_from_cur(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_ptr	*ptr)
 {
-	struct xfs_agi		*agi = cur->bc_private.a.agbp->b_addr;
+	struct xfs_agi		*agi = cur->bc_ag.agbp->b_addr;
 
-	ASSERT(cur->bc_private.a.agno == be32_to_cpu(agi->agi_seqno));
+	ASSERT(cur->bc_ag.agno == be32_to_cpu(agi->agi_seqno));
 
 	ptr->s = agi->agi_root;
 }
@@ -224,9 +224,9 @@ xfs_finobt_init_ptr_from_cur(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_ptr	*ptr)
 {
-	struct xfs_agi		*agi = cur->bc_private.a.agbp->b_addr;
+	struct xfs_agi		*agi = cur->bc_ag.agbp->b_addr;
 
-	ASSERT(cur->bc_private.a.agno == be32_to_cpu(agi->agi_seqno));
+	ASSERT(cur->bc_ag.agno == be32_to_cpu(agi->agi_seqno));
 	ptr->s = agi->agi_free_root;
 }
 
@@ -433,8 +433,8 @@ xfs_inobt_init_cursor(
 	if (xfs_sb_version_hascrc(&mp->m_sb))
 		cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
 
-	cur->bc_private.a.agbp = agbp;
-	cur->bc_private.a.agno = agno;
+	cur->bc_ag.agbp = agbp;
+	cur->bc_ag.agno = agno;
 
 	return cur;
 }
diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
index 6e1665f2cb67..ef3e706f1d94 100644
--- a/fs/xfs/libxfs/xfs_refcount.c
+++ b/fs/xfs/libxfs/xfs_refcount.c
@@ -46,7 +46,7 @@ xfs_refcount_lookup_le(
 	xfs_agblock_t		bno,
 	int			*stat)
 {
-	trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_private.a.agno, bno,
+	trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_ag.agno, bno,
 			XFS_LOOKUP_LE);
 	cur->bc_rec.rc.rc_startblock = bno;
 	cur->bc_rec.rc.rc_blockcount = 0;
@@ -63,7 +63,7 @@ xfs_refcount_lookup_ge(
 	xfs_agblock_t		bno,
 	int			*stat)
 {
-	trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_private.a.agno, bno,
+	trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_ag.agno, bno,
 			XFS_LOOKUP_GE);
 	cur->bc_rec.rc.rc_startblock = bno;
 	cur->bc_rec.rc.rc_blockcount = 0;
@@ -80,7 +80,7 @@ xfs_refcount_lookup_eq(
 	xfs_agblock_t		bno,
 	int			*stat)
 {
-	trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_private.a.agno, bno,
+	trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_ag.agno, bno,
 			XFS_LOOKUP_LE);
 	cur->bc_rec.rc.rc_startblock = bno;
 	cur->bc_rec.rc.rc_blockcount = 0;
@@ -108,7 +108,7 @@ xfs_refcount_get_rec(
 	int				*stat)
 {
 	struct xfs_mount		*mp = cur->bc_mp;
-	xfs_agnumber_t			agno = cur->bc_private.a.agno;
+	xfs_agnumber_t			agno = cur->bc_ag.agno;
 	union xfs_btree_rec		*rec;
 	int				error;
 	xfs_agblock_t			realstart;
@@ -119,7 +119,7 @@ xfs_refcount_get_rec(
 
 	xfs_refcount_btrec_to_irec(rec, irec);
 
-	agno = cur->bc_private.a.agno;
+	agno = cur->bc_ag.agno;
 	if (irec->rc_blockcount == 0 || irec->rc_blockcount > MAXREFCEXTLEN)
 		goto out_bad_rec;
 
@@ -144,7 +144,7 @@ xfs_refcount_get_rec(
 	if (irec->rc_refcount == 0 || irec->rc_refcount > MAXREFCOUNT)
 		goto out_bad_rec;
 
-	trace_xfs_refcount_get(cur->bc_mp, cur->bc_private.a.agno, irec);
+	trace_xfs_refcount_get(cur->bc_mp, cur->bc_ag.agno, irec);
 	return 0;
 
 out_bad_rec:
@@ -169,14 +169,14 @@ xfs_refcount_update(
 	union xfs_btree_rec	rec;
 	int			error;
 
-	trace_xfs_refcount_update(cur->bc_mp, cur->bc_private.a.agno, irec);
+	trace_xfs_refcount_update(cur->bc_mp, cur->bc_ag.agno, irec);
 	rec.refc.rc_startblock = cpu_to_be32(irec->rc_startblock);
 	rec.refc.rc_blockcount = cpu_to_be32(irec->rc_blockcount);
 	rec.refc.rc_refcount = cpu_to_be32(irec->rc_refcount);
 	error = xfs_btree_update(cur, &rec);
 	if (error)
 		trace_xfs_refcount_update_error(cur->bc_mp,
-				cur->bc_private.a.agno, error, _RET_IP_);
+				cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -193,7 +193,7 @@ xfs_refcount_insert(
 {
 	int				error;
 
-	trace_xfs_refcount_insert(cur->bc_mp, cur->bc_private.a.agno, irec);
+	trace_xfs_refcount_insert(cur->bc_mp, cur->bc_ag.agno, irec);
 	cur->bc_rec.rc.rc_startblock = irec->rc_startblock;
 	cur->bc_rec.rc.rc_blockcount = irec->rc_blockcount;
 	cur->bc_rec.rc.rc_refcount = irec->rc_refcount;
@@ -208,7 +208,7 @@ xfs_refcount_insert(
 out_error:
 	if (error)
 		trace_xfs_refcount_insert_error(cur->bc_mp,
-				cur->bc_private.a.agno, error, _RET_IP_);
+				cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -234,7 +234,7 @@ xfs_refcount_delete(
 		error = -EFSCORRUPTED;
 		goto out_error;
 	}
-	trace_xfs_refcount_delete(cur->bc_mp, cur->bc_private.a.agno, &irec);
+	trace_xfs_refcount_delete(cur->bc_mp, cur->bc_ag.agno, &irec);
 	error = xfs_btree_delete(cur, i);
 	if (XFS_IS_CORRUPT(cur->bc_mp, *i != 1)) {
 		error = -EFSCORRUPTED;
@@ -246,7 +246,7 @@ xfs_refcount_delete(
 out_error:
 	if (error)
 		trace_xfs_refcount_delete_error(cur->bc_mp,
-				cur->bc_private.a.agno, error, _RET_IP_);
+				cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -366,7 +366,7 @@ xfs_refcount_split_extent(
 		return 0;
 
 	*shape_changed = true;
-	trace_xfs_refcount_split_extent(cur->bc_mp, cur->bc_private.a.agno,
+	trace_xfs_refcount_split_extent(cur->bc_mp, cur->bc_ag.agno,
 			&rcext, agbno);
 
 	/* Establish the right extent. */
@@ -391,7 +391,7 @@ xfs_refcount_split_extent(
 
 out_error:
 	trace_xfs_refcount_split_extent_error(cur->bc_mp,
-			cur->bc_private.a.agno, error, _RET_IP_);
+			cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -411,7 +411,7 @@ xfs_refcount_merge_center_extents(
 	int				found_rec;
 
 	trace_xfs_refcount_merge_center_extents(cur->bc_mp,
-			cur->bc_private.a.agno, left, center, right);
+			cur->bc_ag.agno, left, center, right);
 
 	/*
 	 * Make sure the center and right extents are not in the btree.
@@ -468,7 +468,7 @@ xfs_refcount_merge_center_extents(
 
 out_error:
 	trace_xfs_refcount_merge_center_extents_error(cur->bc_mp,
-			cur->bc_private.a.agno, error, _RET_IP_);
+			cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -487,7 +487,7 @@ xfs_refcount_merge_left_extent(
 	int				found_rec;
 
 	trace_xfs_refcount_merge_left_extent(cur->bc_mp,
-			cur->bc_private.a.agno, left, cleft);
+			cur->bc_ag.agno, left, cleft);
 
 	/* If the extent at agbno (cleft) wasn't synthesized, remove it. */
 	if (cleft->rc_refcount > 1) {
@@ -530,7 +530,7 @@ xfs_refcount_merge_left_extent(
 
 out_error:
 	trace_xfs_refcount_merge_left_extent_error(cur->bc_mp,
-			cur->bc_private.a.agno, error, _RET_IP_);
+			cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -548,7 +548,7 @@ xfs_refcount_merge_right_extent(
 	int				found_rec;
 
 	trace_xfs_refcount_merge_right_extent(cur->bc_mp,
-			cur->bc_private.a.agno, cright, right);
+			cur->bc_ag.agno, cright, right);
 
 	/*
 	 * If the extent ending at agbno+aglen (cright) wasn't synthesized,
@@ -594,7 +594,7 @@ xfs_refcount_merge_right_extent(
 
 out_error:
 	trace_xfs_refcount_merge_right_extent_error(cur->bc_mp,
-			cur->bc_private.a.agno, error, _RET_IP_);
+			cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -679,13 +679,13 @@ xfs_refcount_find_left_extents(
 		cleft->rc_blockcount = aglen;
 		cleft->rc_refcount = 1;
 	}
-	trace_xfs_refcount_find_left_extent(cur->bc_mp, cur->bc_private.a.agno,
+	trace_xfs_refcount_find_left_extent(cur->bc_mp, cur->bc_ag.agno,
 			left, cleft, agbno);
 	return error;
 
 out_error:
 	trace_xfs_refcount_find_left_extent_error(cur->bc_mp,
-			cur->bc_private.a.agno, error, _RET_IP_);
+			cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -768,13 +768,13 @@ xfs_refcount_find_right_extents(
 		cright->rc_blockcount = aglen;
 		cright->rc_refcount = 1;
 	}
-	trace_xfs_refcount_find_right_extent(cur->bc_mp, cur->bc_private.a.agno,
+	trace_xfs_refcount_find_right_extent(cur->bc_mp, cur->bc_ag.agno,
 			cright, right, agbno + aglen);
 	return error;
 
 out_error:
 	trace_xfs_refcount_find_right_extent_error(cur->bc_mp,
-			cur->bc_private.a.agno, error, _RET_IP_);
+			cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -883,7 +883,7 @@ xfs_refcount_still_have_space(
 {
 	unsigned long			overhead;
 
-	overhead = cur->bc_private.a.priv.refc.shape_changes *
+	overhead = cur->bc_ag.priv.refc.shape_changes *
 			xfs_allocfree_log_count(cur->bc_mp, 1);
 	overhead *= cur->bc_mp->m_sb.sb_blocksize;
 
@@ -891,17 +891,17 @@ xfs_refcount_still_have_space(
 	 * Only allow 2 refcount extent updates per transaction if the
 	 * refcount continue update "error" has been injected.
 	 */
-	if (cur->bc_private.a.priv.refc.nr_ops > 2 &&
+	if (cur->bc_ag.priv.refc.nr_ops > 2 &&
 	    XFS_TEST_ERROR(false, cur->bc_mp,
 			XFS_ERRTAG_REFCOUNT_CONTINUE_UPDATE))
 		return false;
 
-	if (cur->bc_private.a.priv.refc.nr_ops == 0)
+	if (cur->bc_ag.priv.refc.nr_ops == 0)
 		return true;
 	else if (overhead > cur->bc_tp->t_log_res)
 		return false;
 	return  cur->bc_tp->t_log_res - overhead >
-		cur->bc_private.a.priv.refc.nr_ops * XFS_REFCOUNT_ITEM_OVERHEAD;
+		cur->bc_ag.priv.refc.nr_ops * XFS_REFCOUNT_ITEM_OVERHEAD;
 }
 
 /*
@@ -952,7 +952,7 @@ xfs_refcount_adjust_extents(
 					ext.rc_startblock - *agbno);
 			tmp.rc_refcount = 1 + adj;
 			trace_xfs_refcount_modify_extent(cur->bc_mp,
-					cur->bc_private.a.agno, &tmp);
+					cur->bc_ag.agno, &tmp);
 
 			/*
 			 * Either cover the hole (increment) or
@@ -968,10 +968,10 @@ xfs_refcount_adjust_extents(
 					error = -EFSCORRUPTED;
 					goto out_error;
 				}
-				cur->bc_private.a.priv.refc.nr_ops++;
+				cur->bc_ag.priv.refc.nr_ops++;
 			} else {
 				fsbno = XFS_AGB_TO_FSB(cur->bc_mp,
-						cur->bc_private.a.agno,
+						cur->bc_ag.agno,
 						tmp.rc_startblock);
 				xfs_bmap_add_free(cur->bc_tp, fsbno,
 						  tmp.rc_blockcount, oinfo);
@@ -998,12 +998,12 @@ xfs_refcount_adjust_extents(
 			goto skip;
 		ext.rc_refcount += adj;
 		trace_xfs_refcount_modify_extent(cur->bc_mp,
-				cur->bc_private.a.agno, &ext);
+				cur->bc_ag.agno, &ext);
 		if (ext.rc_refcount > 1) {
 			error = xfs_refcount_update(cur, &ext);
 			if (error)
 				goto out_error;
-			cur->bc_private.a.priv.refc.nr_ops++;
+			cur->bc_ag.priv.refc.nr_ops++;
 		} else if (ext.rc_refcount == 1) {
 			error = xfs_refcount_delete(cur, &found_rec);
 			if (error)
@@ -1012,11 +1012,11 @@ xfs_refcount_adjust_extents(
 				error = -EFSCORRUPTED;
 				goto out_error;
 			}
-			cur->bc_private.a.priv.refc.nr_ops++;
+			cur->bc_ag.priv.refc.nr_ops++;
 			goto advloop;
 		} else {
 			fsbno = XFS_AGB_TO_FSB(cur->bc_mp,
-					cur->bc_private.a.agno,
+					cur->bc_ag.agno,
 					ext.rc_startblock);
 			xfs_bmap_add_free(cur->bc_tp, fsbno, ext.rc_blockcount,
 					  oinfo);
@@ -1035,7 +1035,7 @@ xfs_refcount_adjust_extents(
 	return error;
 out_error:
 	trace_xfs_refcount_modify_extent_error(cur->bc_mp,
-			cur->bc_private.a.agno, error, _RET_IP_);
+			cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -1057,10 +1057,10 @@ xfs_refcount_adjust(
 	*new_agbno = agbno;
 	*new_aglen = aglen;
 	if (adj == XFS_REFCOUNT_ADJUST_INCREASE)
-		trace_xfs_refcount_increase(cur->bc_mp, cur->bc_private.a.agno,
+		trace_xfs_refcount_increase(cur->bc_mp, cur->bc_ag.agno,
 				agbno, aglen);
 	else
-		trace_xfs_refcount_decrease(cur->bc_mp, cur->bc_private.a.agno,
+		trace_xfs_refcount_decrease(cur->bc_mp, cur->bc_ag.agno,
 				agbno, aglen);
 
 	/*
@@ -1088,7 +1088,7 @@ xfs_refcount_adjust(
 	if (shape_changed)
 		shape_changes++;
 	if (shape_changes)
-		cur->bc_private.a.priv.refc.shape_changes++;
+		cur->bc_ag.priv.refc.shape_changes++;
 
 	/* Now that we've taken care of the ends, adjust the middle extents */
 	error = xfs_refcount_adjust_extents(cur, new_agbno, new_aglen,
@@ -1099,7 +1099,7 @@ xfs_refcount_adjust(
 	return 0;
 
 out_error:
-	trace_xfs_refcount_adjust_error(cur->bc_mp, cur->bc_private.a.agno,
+	trace_xfs_refcount_adjust_error(cur->bc_mp, cur->bc_ag.agno,
 			error, _RET_IP_);
 	return error;
 }
@@ -1115,7 +1115,7 @@ xfs_refcount_finish_one_cleanup(
 
 	if (rcur == NULL)
 		return;
-	agbp = rcur->bc_private.a.agbp;
+	agbp = rcur->bc_ag.agbp;
 	xfs_btree_del_cursor(rcur, error);
 	if (error)
 		xfs_trans_brelse(tp, agbp);
@@ -1165,9 +1165,9 @@ xfs_refcount_finish_one(
 	 * the startblock, get one now.
 	 */
 	rcur = *pcur;
-	if (rcur != NULL && rcur->bc_private.a.agno != agno) {
-		nr_ops = rcur->bc_private.a.priv.refc.nr_ops;
-		shape_changes = rcur->bc_private.a.priv.refc.shape_changes;
+	if (rcur != NULL && rcur->bc_ag.agno != agno) {
+		nr_ops = rcur->bc_ag.priv.refc.nr_ops;
+		shape_changes = rcur->bc_ag.priv.refc.shape_changes;
 		xfs_refcount_finish_one_cleanup(tp, rcur, 0);
 		rcur = NULL;
 		*pcur = NULL;
@@ -1183,8 +1183,8 @@ xfs_refcount_finish_one(
 			error = -ENOMEM;
 			goto out_cur;
 		}
-		rcur->bc_private.a.priv.refc.nr_ops = nr_ops;
-		rcur->bc_private.a.priv.refc.shape_changes = shape_changes;
+		rcur->bc_ag.priv.refc.nr_ops = nr_ops;
+		rcur->bc_ag.priv.refc.shape_changes = shape_changes;
 	}
 	*pcur = rcur;
 
@@ -1303,7 +1303,7 @@ xfs_refcount_find_shared(
 	int				have;
 	int				error;
 
-	trace_xfs_refcount_find_shared(cur->bc_mp, cur->bc_private.a.agno,
+	trace_xfs_refcount_find_shared(cur->bc_mp, cur->bc_ag.agno,
 			agbno, aglen);
 
 	/* By default, skip the whole range */
@@ -1383,12 +1383,12 @@ xfs_refcount_find_shared(
 
 done:
 	trace_xfs_refcount_find_shared_result(cur->bc_mp,
-			cur->bc_private.a.agno, *fbno, *flen);
+			cur->bc_ag.agno, *fbno, *flen);
 
 out_error:
 	if (error)
 		trace_xfs_refcount_find_shared_error(cur->bc_mp,
-				cur->bc_private.a.agno, error, _RET_IP_);
+				cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -1485,7 +1485,7 @@ xfs_refcount_adjust_cow_extents(
 		tmp.rc_blockcount = aglen;
 		tmp.rc_refcount = 1;
 		trace_xfs_refcount_modify_extent(cur->bc_mp,
-				cur->bc_private.a.agno, &tmp);
+				cur->bc_ag.agno, &tmp);
 
 		error = xfs_refcount_insert(cur, &tmp,
 				&found_tmp);
@@ -1513,7 +1513,7 @@ xfs_refcount_adjust_cow_extents(
 
 		ext.rc_refcount = 0;
 		trace_xfs_refcount_modify_extent(cur->bc_mp,
-				cur->bc_private.a.agno, &ext);
+				cur->bc_ag.agno, &ext);
 		error = xfs_refcount_delete(cur, &found_rec);
 		if (error)
 			goto out_error;
@@ -1529,7 +1529,7 @@ xfs_refcount_adjust_cow_extents(
 	return error;
 out_error:
 	trace_xfs_refcount_modify_extent_error(cur->bc_mp,
-			cur->bc_private.a.agno, error, _RET_IP_);
+			cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -1575,7 +1575,7 @@ xfs_refcount_adjust_cow(
 	return 0;
 
 out_error:
-	trace_xfs_refcount_adjust_cow_error(cur->bc_mp, cur->bc_private.a.agno,
+	trace_xfs_refcount_adjust_cow_error(cur->bc_mp, cur->bc_ag.agno,
 			error, _RET_IP_);
 	return error;
 }
@@ -1589,7 +1589,7 @@ __xfs_refcount_cow_alloc(
 	xfs_agblock_t		agbno,
 	xfs_extlen_t		aglen)
 {
-	trace_xfs_refcount_cow_increase(rcur->bc_mp, rcur->bc_private.a.agno,
+	trace_xfs_refcount_cow_increase(rcur->bc_mp, rcur->bc_ag.agno,
 			agbno, aglen);
 
 	/* Add refcount btree reservation */
@@ -1606,7 +1606,7 @@ __xfs_refcount_cow_free(
 	xfs_agblock_t		agbno,
 	xfs_extlen_t		aglen)
 {
-	trace_xfs_refcount_cow_decrease(rcur->bc_mp, rcur->bc_private.a.agno,
+	trace_xfs_refcount_cow_decrease(rcur->bc_mp, rcur->bc_ag.agno,
 			agbno, aglen);
 
 	/* Remove refcount btree reservation */
diff --git a/fs/xfs/libxfs/xfs_refcount_btree.c b/fs/xfs/libxfs/xfs_refcount_btree.c
index a76997740e45..bf1a4cb3c7ac 100644
--- a/fs/xfs/libxfs/xfs_refcount_btree.c
+++ b/fs/xfs/libxfs/xfs_refcount_btree.c
@@ -25,7 +25,7 @@ xfs_refcountbt_dup_cursor(
 	struct xfs_btree_cur	*cur)
 {
 	return xfs_refcountbt_init_cursor(cur->bc_mp, cur->bc_tp,
-			cur->bc_private.a.agbp, cur->bc_private.a.agno);
+			cur->bc_ag.agbp, cur->bc_ag.agno);
 }
 
 STATIC void
@@ -34,7 +34,7 @@ xfs_refcountbt_set_root(
 	union xfs_btree_ptr	*ptr,
 	int			inc)
 {
-	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
+	struct xfs_buf		*agbp = cur->bc_ag.agbp;
 	struct xfs_agf		*agf = agbp->b_addr;
 	xfs_agnumber_t		seqno = be32_to_cpu(agf->agf_seqno);
 	struct xfs_perag	*pag = xfs_perag_get(cur->bc_mp, seqno);
@@ -57,7 +57,7 @@ xfs_refcountbt_alloc_block(
 	union xfs_btree_ptr	*new,
 	int			*stat)
 {
-	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
+	struct xfs_buf		*agbp = cur->bc_ag.agbp;
 	struct xfs_agf		*agf = agbp->b_addr;
 	struct xfs_alloc_arg	args;		/* block allocation args */
 	int			error;		/* error return value */
@@ -66,7 +66,7 @@ xfs_refcountbt_alloc_block(
 	args.tp = cur->bc_tp;
 	args.mp = cur->bc_mp;
 	args.type = XFS_ALLOCTYPE_NEAR_BNO;
-	args.fsbno = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno,
+	args.fsbno = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_ag.agno,
 			xfs_refc_block(args.mp));
 	args.oinfo = XFS_RMAP_OINFO_REFC;
 	args.minlen = args.maxlen = args.prod = 1;
@@ -75,13 +75,13 @@ xfs_refcountbt_alloc_block(
 	error = xfs_alloc_vextent(&args);
 	if (error)
 		goto out_error;
-	trace_xfs_refcountbt_alloc_block(cur->bc_mp, cur->bc_private.a.agno,
+	trace_xfs_refcountbt_alloc_block(cur->bc_mp, cur->bc_ag.agno,
 			args.agbno, 1);
 	if (args.fsbno == NULLFSBLOCK) {
 		*stat = 0;
 		return 0;
 	}
-	ASSERT(args.agno == cur->bc_private.a.agno);
+	ASSERT(args.agno == cur->bc_ag.agno);
 	ASSERT(args.len == 1);
 
 	new->s = cpu_to_be32(args.agbno);
@@ -101,12 +101,12 @@ xfs_refcountbt_free_block(
 	struct xfs_buf		*bp)
 {
 	struct xfs_mount	*mp = cur->bc_mp;
-	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
+	struct xfs_buf		*agbp = cur->bc_ag.agbp;
 	struct xfs_agf		*agf = agbp->b_addr;
 	xfs_fsblock_t		fsbno = XFS_DADDR_TO_FSB(mp, XFS_BUF_ADDR(bp));
 	int			error;
 
-	trace_xfs_refcountbt_free_block(cur->bc_mp, cur->bc_private.a.agno,
+	trace_xfs_refcountbt_free_block(cur->bc_mp, cur->bc_ag.agno,
 			XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno), 1);
 	be32_add_cpu(&agf->agf_refcount_blocks, -1);
 	xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_REFCOUNT_BLOCKS);
@@ -169,9 +169,9 @@ xfs_refcountbt_init_ptr_from_cur(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_ptr	*ptr)
 {
-	struct xfs_agf		*agf = cur->bc_private.a.agbp->b_addr;
+	struct xfs_agf		*agf = cur->bc_ag.agbp->b_addr;
 
-	ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno));
+	ASSERT(cur->bc_ag.agno == be32_to_cpu(agf->agf_seqno));
 
 	ptr->s = agf->agf_refcount_root;
 }
@@ -336,12 +336,12 @@ xfs_refcountbt_init_cursor(
 
 	cur->bc_nlevels = be32_to_cpu(agf->agf_refcount_level);
 
-	cur->bc_private.a.agbp = agbp;
-	cur->bc_private.a.agno = agno;
+	cur->bc_ag.agbp = agbp;
+	cur->bc_ag.agno = agno;
 	cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
 
-	cur->bc_private.a.priv.refc.nr_ops = 0;
-	cur->bc_private.a.priv.refc.shape_changes = 0;
+	cur->bc_ag.priv.refc.nr_ops = 0;
+	cur->bc_ag.priv.refc.shape_changes = 0;
 
 	return cur;
 }
diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c
index dae1a2bf28eb..27c39268c31f 100644
--- a/fs/xfs/libxfs/xfs_rmap.c
+++ b/fs/xfs/libxfs/xfs_rmap.c
@@ -79,7 +79,7 @@ xfs_rmap_update(
 	union xfs_btree_rec	rec;
 	int			error;
 
-	trace_xfs_rmap_update(cur->bc_mp, cur->bc_private.a.agno,
+	trace_xfs_rmap_update(cur->bc_mp, cur->bc_ag.agno,
 			irec->rm_startblock, irec->rm_blockcount,
 			irec->rm_owner, irec->rm_offset, irec->rm_flags);
 
@@ -91,7 +91,7 @@ xfs_rmap_update(
 	error = xfs_btree_update(cur, &rec);
 	if (error)
 		trace_xfs_rmap_update_error(cur->bc_mp,
-				cur->bc_private.a.agno, error, _RET_IP_);
+				cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -107,7 +107,7 @@ xfs_rmap_insert(
 	int			i;
 	int			error;
 
-	trace_xfs_rmap_insert(rcur->bc_mp, rcur->bc_private.a.agno, agbno,
+	trace_xfs_rmap_insert(rcur->bc_mp, rcur->bc_ag.agno, agbno,
 			len, owner, offset, flags);
 
 	error = xfs_rmap_lookup_eq(rcur, agbno, len, owner, offset, flags, &i);
@@ -133,7 +133,7 @@ xfs_rmap_insert(
 done:
 	if (error)
 		trace_xfs_rmap_insert_error(rcur->bc_mp,
-				rcur->bc_private.a.agno, error, _RET_IP_);
+				rcur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -149,7 +149,7 @@ xfs_rmap_delete(
 	int			i;
 	int			error;
 
-	trace_xfs_rmap_delete(rcur->bc_mp, rcur->bc_private.a.agno, agbno,
+	trace_xfs_rmap_delete(rcur->bc_mp, rcur->bc_ag.agno, agbno,
 			len, owner, offset, flags);
 
 	error = xfs_rmap_lookup_eq(rcur, agbno, len, owner, offset, flags, &i);
@@ -170,7 +170,7 @@ xfs_rmap_delete(
 done:
 	if (error)
 		trace_xfs_rmap_delete_error(rcur->bc_mp,
-				rcur->bc_private.a.agno, error, _RET_IP_);
+				rcur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -197,7 +197,7 @@ xfs_rmap_get_rec(
 	int			*stat)
 {
 	struct xfs_mount	*mp = cur->bc_mp;
-	xfs_agnumber_t		agno = cur->bc_private.a.agno;
+	xfs_agnumber_t		agno = cur->bc_ag.agno;
 	union xfs_btree_rec	*rec;
 	int			error;
 
@@ -260,7 +260,7 @@ xfs_rmap_find_left_neighbor_helper(
 	struct xfs_find_left_neighbor_info	*info = priv;
 
 	trace_xfs_rmap_find_left_neighbor_candidate(cur->bc_mp,
-			cur->bc_private.a.agno, rec->rm_startblock,
+			cur->bc_ag.agno, rec->rm_startblock,
 			rec->rm_blockcount, rec->rm_owner, rec->rm_offset,
 			rec->rm_flags);
 
@@ -312,7 +312,7 @@ xfs_rmap_find_left_neighbor(
 	info.stat = stat;
 
 	trace_xfs_rmap_find_left_neighbor_query(cur->bc_mp,
-			cur->bc_private.a.agno, bno, 0, owner, offset, flags);
+			cur->bc_ag.agno, bno, 0, owner, offset, flags);
 
 	error = xfs_rmap_query_range(cur, &info.high, &info.high,
 			xfs_rmap_find_left_neighbor_helper, &info);
@@ -320,7 +320,7 @@ xfs_rmap_find_left_neighbor(
 		error = 0;
 	if (*stat)
 		trace_xfs_rmap_find_left_neighbor_result(cur->bc_mp,
-				cur->bc_private.a.agno, irec->rm_startblock,
+				cur->bc_ag.agno, irec->rm_startblock,
 				irec->rm_blockcount, irec->rm_owner,
 				irec->rm_offset, irec->rm_flags);
 	return error;
@@ -336,7 +336,7 @@ xfs_rmap_lookup_le_range_helper(
 	struct xfs_find_left_neighbor_info	*info = priv;
 
 	trace_xfs_rmap_lookup_le_range_candidate(cur->bc_mp,
-			cur->bc_private.a.agno, rec->rm_startblock,
+			cur->bc_ag.agno, rec->rm_startblock,
 			rec->rm_blockcount, rec->rm_owner, rec->rm_offset,
 			rec->rm_flags);
 
@@ -385,14 +385,14 @@ xfs_rmap_lookup_le_range(
 	info.stat = stat;
 
 	trace_xfs_rmap_lookup_le_range(cur->bc_mp,
-			cur->bc_private.a.agno, bno, 0, owner, offset, flags);
+			cur->bc_ag.agno, bno, 0, owner, offset, flags);
 	error = xfs_rmap_query_range(cur, &info.high, &info.high,
 			xfs_rmap_lookup_le_range_helper, &info);
 	if (error == -ECANCELED)
 		error = 0;
 	if (*stat)
 		trace_xfs_rmap_lookup_le_range_result(cur->bc_mp,
-				cur->bc_private.a.agno, irec->rm_startblock,
+				cur->bc_ag.agno, irec->rm_startblock,
 				irec->rm_blockcount, irec->rm_owner,
 				irec->rm_offset, irec->rm_flags);
 	return error;
@@ -498,7 +498,7 @@ xfs_rmap_unmap(
 			(flags & XFS_RMAP_BMBT_BLOCK);
 	if (unwritten)
 		flags |= XFS_RMAP_UNWRITTEN;
-	trace_xfs_rmap_unmap(mp, cur->bc_private.a.agno, bno, len,
+	trace_xfs_rmap_unmap(mp, cur->bc_ag.agno, bno, len,
 			unwritten, oinfo);
 
 	/*
@@ -522,7 +522,7 @@ xfs_rmap_unmap(
 		goto out_error;
 	}
 	trace_xfs_rmap_lookup_le_range_result(cur->bc_mp,
-			cur->bc_private.a.agno, ltrec.rm_startblock,
+			cur->bc_ag.agno, ltrec.rm_startblock,
 			ltrec.rm_blockcount, ltrec.rm_owner,
 			ltrec.rm_offset, ltrec.rm_flags);
 	ltoff = ltrec.rm_offset;
@@ -588,7 +588,7 @@ xfs_rmap_unmap(
 
 	if (ltrec.rm_startblock == bno && ltrec.rm_blockcount == len) {
 		/* exact match, simply remove the record from rmap tree */
-		trace_xfs_rmap_delete(mp, cur->bc_private.a.agno,
+		trace_xfs_rmap_delete(mp, cur->bc_ag.agno,
 				ltrec.rm_startblock, ltrec.rm_blockcount,
 				ltrec.rm_owner, ltrec.rm_offset,
 				ltrec.rm_flags);
@@ -666,7 +666,7 @@ xfs_rmap_unmap(
 		else
 			cur->bc_rec.r.rm_offset = offset + len;
 		cur->bc_rec.r.rm_flags = flags;
-		trace_xfs_rmap_insert(mp, cur->bc_private.a.agno,
+		trace_xfs_rmap_insert(mp, cur->bc_ag.agno,
 				cur->bc_rec.r.rm_startblock,
 				cur->bc_rec.r.rm_blockcount,
 				cur->bc_rec.r.rm_owner,
@@ -678,11 +678,11 @@ xfs_rmap_unmap(
 	}
 
 out_done:
-	trace_xfs_rmap_unmap_done(mp, cur->bc_private.a.agno, bno, len,
+	trace_xfs_rmap_unmap_done(mp, cur->bc_ag.agno, bno, len,
 			unwritten, oinfo);
 out_error:
 	if (error)
-		trace_xfs_rmap_unmap_error(mp, cur->bc_private.a.agno,
+		trace_xfs_rmap_unmap_error(mp, cur->bc_ag.agno,
 				error, _RET_IP_);
 	return error;
 }
@@ -773,7 +773,7 @@ xfs_rmap_map(
 			(flags & XFS_RMAP_BMBT_BLOCK);
 	if (unwritten)
 		flags |= XFS_RMAP_UNWRITTEN;
-	trace_xfs_rmap_map(mp, cur->bc_private.a.agno, bno, len,
+	trace_xfs_rmap_map(mp, cur->bc_ag.agno, bno, len,
 			unwritten, oinfo);
 	ASSERT(!xfs_rmap_should_skip_owner_update(oinfo));
 
@@ -795,7 +795,7 @@ xfs_rmap_map(
 			goto out_error;
 		}
 		trace_xfs_rmap_lookup_le_range_result(cur->bc_mp,
-				cur->bc_private.a.agno, ltrec.rm_startblock,
+				cur->bc_ag.agno, ltrec.rm_startblock,
 				ltrec.rm_blockcount, ltrec.rm_owner,
 				ltrec.rm_offset, ltrec.rm_flags);
 
@@ -831,7 +831,7 @@ xfs_rmap_map(
 			goto out_error;
 		}
 		trace_xfs_rmap_find_right_neighbor_result(cur->bc_mp,
-			cur->bc_private.a.agno, gtrec.rm_startblock,
+			cur->bc_ag.agno, gtrec.rm_startblock,
 			gtrec.rm_blockcount, gtrec.rm_owner,
 			gtrec.rm_offset, gtrec.rm_flags);
 		if (!xfs_rmap_is_mergeable(&gtrec, owner, flags))
@@ -870,7 +870,7 @@ xfs_rmap_map(
 			 * result: |rrrrrrrrrrrrrrrrrrrrrrrrrrrrr|
 			 */
 			ltrec.rm_blockcount += gtrec.rm_blockcount;
-			trace_xfs_rmap_delete(mp, cur->bc_private.a.agno,
+			trace_xfs_rmap_delete(mp, cur->bc_ag.agno,
 					gtrec.rm_startblock,
 					gtrec.rm_blockcount,
 					gtrec.rm_owner,
@@ -921,7 +921,7 @@ xfs_rmap_map(
 		cur->bc_rec.r.rm_owner = owner;
 		cur->bc_rec.r.rm_offset = offset;
 		cur->bc_rec.r.rm_flags = flags;
-		trace_xfs_rmap_insert(mp, cur->bc_private.a.agno, bno, len,
+		trace_xfs_rmap_insert(mp, cur->bc_ag.agno, bno, len,
 			owner, offset, flags);
 		error = xfs_btree_insert(cur, &i);
 		if (error)
@@ -932,11 +932,11 @@ xfs_rmap_map(
 		}
 	}
 
-	trace_xfs_rmap_map_done(mp, cur->bc_private.a.agno, bno, len,
+	trace_xfs_rmap_map_done(mp, cur->bc_ag.agno, bno, len,
 			unwritten, oinfo);
 out_error:
 	if (error)
-		trace_xfs_rmap_map_error(mp, cur->bc_private.a.agno,
+		trace_xfs_rmap_map_error(mp, cur->bc_ag.agno,
 				error, _RET_IP_);
 	return error;
 }
@@ -1010,7 +1010,7 @@ xfs_rmap_convert(
 			(flags & (XFS_RMAP_ATTR_FORK | XFS_RMAP_BMBT_BLOCK))));
 	oldext = unwritten ? XFS_RMAP_UNWRITTEN : 0;
 	new_endoff = offset + len;
-	trace_xfs_rmap_convert(mp, cur->bc_private.a.agno, bno, len,
+	trace_xfs_rmap_convert(mp, cur->bc_ag.agno, bno, len,
 			unwritten, oinfo);
 
 	/*
@@ -1034,7 +1034,7 @@ xfs_rmap_convert(
 		goto done;
 	}
 	trace_xfs_rmap_lookup_le_range_result(cur->bc_mp,
-			cur->bc_private.a.agno, PREV.rm_startblock,
+			cur->bc_ag.agno, PREV.rm_startblock,
 			PREV.rm_blockcount, PREV.rm_owner,
 			PREV.rm_offset, PREV.rm_flags);
 
@@ -1076,7 +1076,7 @@ xfs_rmap_convert(
 			goto done;
 		}
 		trace_xfs_rmap_find_left_neighbor_result(cur->bc_mp,
-				cur->bc_private.a.agno, LEFT.rm_startblock,
+				cur->bc_ag.agno, LEFT.rm_startblock,
 				LEFT.rm_blockcount, LEFT.rm_owner,
 				LEFT.rm_offset, LEFT.rm_flags);
 		if (LEFT.rm_startblock + LEFT.rm_blockcount == bno &&
@@ -1114,7 +1114,7 @@ xfs_rmap_convert(
 			goto done;
 		}
 		trace_xfs_rmap_find_right_neighbor_result(cur->bc_mp,
-				cur->bc_private.a.agno, RIGHT.rm_startblock,
+				cur->bc_ag.agno, RIGHT.rm_startblock,
 				RIGHT.rm_blockcount, RIGHT.rm_owner,
 				RIGHT.rm_offset, RIGHT.rm_flags);
 		if (bno + len == RIGHT.rm_startblock &&
@@ -1132,7 +1132,7 @@ xfs_rmap_convert(
 	     RIGHT.rm_blockcount > XFS_RMAP_LEN_MAX)
 		state &= ~RMAP_RIGHT_CONTIG;
 
-	trace_xfs_rmap_convert_state(mp, cur->bc_private.a.agno, state,
+	trace_xfs_rmap_convert_state(mp, cur->bc_ag.agno, state,
 			_RET_IP_);
 
 	/* reset the cursor back to PREV */
@@ -1162,7 +1162,7 @@ xfs_rmap_convert(
 			error = -EFSCORRUPTED;
 			goto done;
 		}
-		trace_xfs_rmap_delete(mp, cur->bc_private.a.agno,
+		trace_xfs_rmap_delete(mp, cur->bc_ag.agno,
 				RIGHT.rm_startblock, RIGHT.rm_blockcount,
 				RIGHT.rm_owner, RIGHT.rm_offset,
 				RIGHT.rm_flags);
@@ -1180,7 +1180,7 @@ xfs_rmap_convert(
 			error = -EFSCORRUPTED;
 			goto done;
 		}
-		trace_xfs_rmap_delete(mp, cur->bc_private.a.agno,
+		trace_xfs_rmap_delete(mp, cur->bc_ag.agno,
 				PREV.rm_startblock, PREV.rm_blockcount,
 				PREV.rm_owner, PREV.rm_offset,
 				PREV.rm_flags);
@@ -1210,7 +1210,7 @@ xfs_rmap_convert(
 		 * Setting all of a previous oldext extent to newext.
 		 * The left neighbor is contiguous, the right is not.
 		 */
-		trace_xfs_rmap_delete(mp, cur->bc_private.a.agno,
+		trace_xfs_rmap_delete(mp, cur->bc_ag.agno,
 				PREV.rm_startblock, PREV.rm_blockcount,
 				PREV.rm_owner, PREV.rm_offset,
 				PREV.rm_flags);
@@ -1247,7 +1247,7 @@ xfs_rmap_convert(
 			error = -EFSCORRUPTED;
 			goto done;
 		}
-		trace_xfs_rmap_delete(mp, cur->bc_private.a.agno,
+		trace_xfs_rmap_delete(mp, cur->bc_ag.agno,
 				RIGHT.rm_startblock, RIGHT.rm_blockcount,
 				RIGHT.rm_owner, RIGHT.rm_offset,
 				RIGHT.rm_flags);
@@ -1326,7 +1326,7 @@ xfs_rmap_convert(
 		NEW.rm_blockcount = len;
 		NEW.rm_flags = newext;
 		cur->bc_rec.r = NEW;
-		trace_xfs_rmap_insert(mp, cur->bc_private.a.agno, bno,
+		trace_xfs_rmap_insert(mp, cur->bc_ag.agno, bno,
 				len, owner, offset, newext);
 		error = xfs_btree_insert(cur, &i);
 		if (error)
@@ -1383,7 +1383,7 @@ xfs_rmap_convert(
 		NEW.rm_blockcount = len;
 		NEW.rm_flags = newext;
 		cur->bc_rec.r = NEW;
-		trace_xfs_rmap_insert(mp, cur->bc_private.a.agno, bno,
+		trace_xfs_rmap_insert(mp, cur->bc_ag.agno, bno,
 				len, owner, offset, newext);
 		error = xfs_btree_insert(cur, &i);
 		if (error)
@@ -1414,7 +1414,7 @@ xfs_rmap_convert(
 		NEW = PREV;
 		NEW.rm_blockcount = offset - PREV.rm_offset;
 		cur->bc_rec.r = NEW;
-		trace_xfs_rmap_insert(mp, cur->bc_private.a.agno,
+		trace_xfs_rmap_insert(mp, cur->bc_ag.agno,
 				NEW.rm_startblock, NEW.rm_blockcount,
 				NEW.rm_owner, NEW.rm_offset,
 				NEW.rm_flags);
@@ -1441,7 +1441,7 @@ xfs_rmap_convert(
 		/* new middle extent - newext */
 		cur->bc_rec.r.rm_flags &= ~XFS_RMAP_UNWRITTEN;
 		cur->bc_rec.r.rm_flags |= newext;
-		trace_xfs_rmap_insert(mp, cur->bc_private.a.agno, bno, len,
+		trace_xfs_rmap_insert(mp, cur->bc_ag.agno, bno, len,
 				owner, offset, newext);
 		error = xfs_btree_insert(cur, &i);
 		if (error)
@@ -1465,12 +1465,12 @@ xfs_rmap_convert(
 		ASSERT(0);
 	}
 
-	trace_xfs_rmap_convert_done(mp, cur->bc_private.a.agno, bno, len,
+	trace_xfs_rmap_convert_done(mp, cur->bc_ag.agno, bno, len,
 			unwritten, oinfo);
 done:
 	if (error)
 		trace_xfs_rmap_convert_error(cur->bc_mp,
-				cur->bc_private.a.agno, error, _RET_IP_);
+				cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -1506,7 +1506,7 @@ xfs_rmap_convert_shared(
 			(flags & (XFS_RMAP_ATTR_FORK | XFS_RMAP_BMBT_BLOCK))));
 	oldext = unwritten ? XFS_RMAP_UNWRITTEN : 0;
 	new_endoff = offset + len;
-	trace_xfs_rmap_convert(mp, cur->bc_private.a.agno, bno, len,
+	trace_xfs_rmap_convert(mp, cur->bc_ag.agno, bno, len,
 			unwritten, oinfo);
 
 	/*
@@ -1573,7 +1573,7 @@ xfs_rmap_convert_shared(
 			goto done;
 		}
 		trace_xfs_rmap_find_right_neighbor_result(cur->bc_mp,
-				cur->bc_private.a.agno, RIGHT.rm_startblock,
+				cur->bc_ag.agno, RIGHT.rm_startblock,
 				RIGHT.rm_blockcount, RIGHT.rm_owner,
 				RIGHT.rm_offset, RIGHT.rm_flags);
 		if (xfs_rmap_is_mergeable(&RIGHT, owner, newext))
@@ -1589,7 +1589,7 @@ xfs_rmap_convert_shared(
 	     RIGHT.rm_blockcount > XFS_RMAP_LEN_MAX)
 		state &= ~RMAP_RIGHT_CONTIG;
 
-	trace_xfs_rmap_convert_state(mp, cur->bc_private.a.agno, state,
+	trace_xfs_rmap_convert_state(mp, cur->bc_ag.agno, state,
 			_RET_IP_);
 	/*
 	 * Switch out based on the FILLING and CONTIG state bits.
@@ -1880,12 +1880,12 @@ xfs_rmap_convert_shared(
 		ASSERT(0);
 	}
 
-	trace_xfs_rmap_convert_done(mp, cur->bc_private.a.agno, bno, len,
+	trace_xfs_rmap_convert_done(mp, cur->bc_ag.agno, bno, len,
 			unwritten, oinfo);
 done:
 	if (error)
 		trace_xfs_rmap_convert_error(cur->bc_mp,
-				cur->bc_private.a.agno, error, _RET_IP_);
+				cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -1923,7 +1923,7 @@ xfs_rmap_unmap_shared(
 	xfs_owner_info_unpack(oinfo, &owner, &offset, &flags);
 	if (unwritten)
 		flags |= XFS_RMAP_UNWRITTEN;
-	trace_xfs_rmap_unmap(mp, cur->bc_private.a.agno, bno, len,
+	trace_xfs_rmap_unmap(mp, cur->bc_ag.agno, bno, len,
 			unwritten, oinfo);
 
 	/*
@@ -2072,12 +2072,12 @@ xfs_rmap_unmap_shared(
 			goto out_error;
 	}
 
-	trace_xfs_rmap_unmap_done(mp, cur->bc_private.a.agno, bno, len,
+	trace_xfs_rmap_unmap_done(mp, cur->bc_ag.agno, bno, len,
 			unwritten, oinfo);
 out_error:
 	if (error)
 		trace_xfs_rmap_unmap_error(cur->bc_mp,
-				cur->bc_private.a.agno, error, _RET_IP_);
+				cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -2112,7 +2112,7 @@ xfs_rmap_map_shared(
 	xfs_owner_info_unpack(oinfo, &owner, &offset, &flags);
 	if (unwritten)
 		flags |= XFS_RMAP_UNWRITTEN;
-	trace_xfs_rmap_map(mp, cur->bc_private.a.agno, bno, len,
+	trace_xfs_rmap_map(mp, cur->bc_ag.agno, bno, len,
 			unwritten, oinfo);
 
 	/* Is there a left record that abuts our range? */
@@ -2138,7 +2138,7 @@ xfs_rmap_map_shared(
 			goto out_error;
 		}
 		trace_xfs_rmap_find_right_neighbor_result(cur->bc_mp,
-			cur->bc_private.a.agno, gtrec.rm_startblock,
+			cur->bc_ag.agno, gtrec.rm_startblock,
 			gtrec.rm_blockcount, gtrec.rm_owner,
 			gtrec.rm_offset, gtrec.rm_flags);
 
@@ -2231,12 +2231,12 @@ xfs_rmap_map_shared(
 			goto out_error;
 	}
 
-	trace_xfs_rmap_map_done(mp, cur->bc_private.a.agno, bno, len,
+	trace_xfs_rmap_map_done(mp, cur->bc_ag.agno, bno, len,
 			unwritten, oinfo);
 out_error:
 	if (error)
 		trace_xfs_rmap_map_error(cur->bc_mp,
-				cur->bc_private.a.agno, error, _RET_IP_);
+				cur->bc_ag.agno, error, _RET_IP_);
 	return error;
 }
 
@@ -2336,7 +2336,7 @@ xfs_rmap_finish_one_cleanup(
 
 	if (rcur == NULL)
 		return;
-	agbp = rcur->bc_private.a.agbp;
+	agbp = rcur->bc_ag.agbp;
 	xfs_btree_del_cursor(rcur, error);
 	if (error)
 		xfs_trans_brelse(tp, agbp);
@@ -2386,7 +2386,7 @@ xfs_rmap_finish_one(
 	 * the startblock, get one now.
 	 */
 	rcur = *pcur;
-	if (rcur != NULL && rcur->bc_private.a.agno != agno) {
+	if (rcur != NULL && rcur->bc_ag.agno != agno) {
 		xfs_rmap_finish_one_cleanup(tp, rcur, 0);
 		rcur = NULL;
 		*pcur = NULL;
diff --git a/fs/xfs/libxfs/xfs_rmap_btree.c b/fs/xfs/libxfs/xfs_rmap_btree.c
index 725cb892f157..af7e4966416f 100644
--- a/fs/xfs/libxfs/xfs_rmap_btree.c
+++ b/fs/xfs/libxfs/xfs_rmap_btree.c
@@ -51,7 +51,7 @@ xfs_rmapbt_dup_cursor(
 	struct xfs_btree_cur	*cur)
 {
 	return xfs_rmapbt_init_cursor(cur->bc_mp, cur->bc_tp,
-			cur->bc_private.a.agbp, cur->bc_private.a.agno);
+			cur->bc_ag.agbp, cur->bc_ag.agno);
 }
 
 STATIC void
@@ -60,7 +60,7 @@ xfs_rmapbt_set_root(
 	union xfs_btree_ptr	*ptr,
 	int			inc)
 {
-	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
+	struct xfs_buf		*agbp = cur->bc_ag.agbp;
 	struct xfs_agf		*agf = agbp->b_addr;
 	xfs_agnumber_t		seqno = be32_to_cpu(agf->agf_seqno);
 	int			btnum = cur->bc_btnum;
@@ -83,25 +83,25 @@ xfs_rmapbt_alloc_block(
 	union xfs_btree_ptr	*new,
 	int			*stat)
 {
-	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
+	struct xfs_buf		*agbp = cur->bc_ag.agbp;
 	struct xfs_agf		*agf = agbp->b_addr;
 	int			error;
 	xfs_agblock_t		bno;
 
 	/* Allocate the new block from the freelist. If we can't, give up.  */
-	error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_private.a.agbp,
+	error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_ag.agbp,
 				       &bno, 1);
 	if (error)
 		return error;
 
-	trace_xfs_rmapbt_alloc_block(cur->bc_mp, cur->bc_private.a.agno,
+	trace_xfs_rmapbt_alloc_block(cur->bc_mp, cur->bc_ag.agno,
 			bno, 1);
 	if (bno == NULLAGBLOCK) {
 		*stat = 0;
 		return 0;
 	}
 
-	xfs_extent_busy_reuse(cur->bc_mp, cur->bc_private.a.agno, bno, 1,
+	xfs_extent_busy_reuse(cur->bc_mp, cur->bc_ag.agno, bno, 1,
 			false);
 
 	xfs_trans_agbtree_delta(cur->bc_tp, 1);
@@ -109,7 +109,7 @@ xfs_rmapbt_alloc_block(
 	be32_add_cpu(&agf->agf_rmap_blocks, 1);
 	xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_RMAP_BLOCKS);
 
-	xfs_ag_resv_rmapbt_alloc(cur->bc_mp, cur->bc_private.a.agno);
+	xfs_ag_resv_rmapbt_alloc(cur->bc_mp, cur->bc_ag.agno);
 
 	*stat = 1;
 	return 0;
@@ -120,13 +120,13 @@ xfs_rmapbt_free_block(
 	struct xfs_btree_cur	*cur,
 	struct xfs_buf		*bp)
 {
-	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
+	struct xfs_buf		*agbp = cur->bc_ag.agbp;
 	struct xfs_agf		*agf = agbp->b_addr;
 	xfs_agblock_t		bno;
 	int			error;
 
 	bno = xfs_daddr_to_agbno(cur->bc_mp, XFS_BUF_ADDR(bp));
-	trace_xfs_rmapbt_free_block(cur->bc_mp, cur->bc_private.a.agno,
+	trace_xfs_rmapbt_free_block(cur->bc_mp, cur->bc_ag.agno,
 			bno, 1);
 	be32_add_cpu(&agf->agf_rmap_blocks, -1);
 	xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_RMAP_BLOCKS);
@@ -138,7 +138,7 @@ xfs_rmapbt_free_block(
 			      XFS_EXTENT_BUSY_SKIP_DISCARD);
 	xfs_trans_agbtree_delta(cur->bc_tp, -1);
 
-	xfs_ag_resv_rmapbt_free(cur->bc_mp, cur->bc_private.a.agno);
+	xfs_ag_resv_rmapbt_free(cur->bc_mp, cur->bc_ag.agno);
 
 	return 0;
 }
@@ -215,9 +215,9 @@ xfs_rmapbt_init_ptr_from_cur(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_ptr	*ptr)
 {
-	struct xfs_agf		*agf = cur->bc_private.a.agbp->b_addr;
+	struct xfs_agf		*agf = cur->bc_ag.agbp->b_addr;
 
-	ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno));
+	ASSERT(cur->bc_ag.agno == be32_to_cpu(agf->agf_seqno));
 
 	ptr->s = agf->agf_roots[cur->bc_btnum];
 }
@@ -472,8 +472,8 @@ xfs_rmapbt_init_cursor(
 	cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]);
 	cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_rmap_2);
 
-	cur->bc_private.a.agbp = agbp;
-	cur->bc_private.a.agno = agno;
+	cur->bc_ag.agbp = agbp;
+	cur->bc_ag.agno = agno;
 
 	return cur;
 }
diff --git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c
index 9b3954d7f7d9..73e6efd76877 100644
--- a/fs/xfs/scrub/agheader_repair.c
+++ b/fs/xfs/scrub/agheader_repair.c
@@ -453,7 +453,7 @@ xrep_agfl_walk_rmap(
 
 	/* Record all the OWN_AG blocks. */
 	if (rec->rm_owner == XFS_RMAP_OWN_AG) {
-		fsb = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno,
+		fsb = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_ag.agno,
 				rec->rm_startblock);
 		error = xfs_bitmap_set(ra->freesp, fsb, rec->rm_blockcount);
 		if (error)
diff --git a/fs/xfs/scrub/alloc.c b/fs/xfs/scrub/alloc.c
index 5533e48e605d..73d924e47565 100644
--- a/fs/xfs/scrub/alloc.c
+++ b/fs/xfs/scrub/alloc.c
@@ -94,7 +94,7 @@ xchk_allocbt_rec(
 	union xfs_btree_rec	*rec)
 {
 	struct xfs_mount	*mp = bs->cur->bc_mp;
-	xfs_agnumber_t		agno = bs->cur->bc_private.a.agno;
+	xfs_agnumber_t		agno = bs->cur->bc_ag.agno;
 	xfs_agblock_t		bno;
 	xfs_extlen_t		len;
 
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
index fa6ea6407992..1c866594ec34 100644
--- a/fs/xfs/scrub/bmap.c
+++ b/fs/xfs/scrub/bmap.c
@@ -501,7 +501,7 @@ xchk_bmap_check_rmap(
 			xchk_fblock_set_corrupt(sc, sbcri->whichfork,
 					rec->rm_offset);
 		if (irec.br_startblock != XFS_AGB_TO_FSB(sc->mp,
-				cur->bc_private.a.agno, rec->rm_startblock))
+				cur->bc_ag.agno, rec->rm_startblock))
 			xchk_fblock_set_corrupt(sc, sbcri->whichfork,
 					rec->rm_offset);
 		if (irec.br_blockcount > rec->rm_blockcount)
diff --git a/fs/xfs/scrub/ialloc.c b/fs/xfs/scrub/ialloc.c
index 681758704fda..64c217eb06a7 100644
--- a/fs/xfs/scrub/ialloc.c
+++ b/fs/xfs/scrub/ialloc.c
@@ -104,7 +104,7 @@ xchk_iallocbt_chunk(
 	xfs_extlen_t			len)
 {
 	struct xfs_mount		*mp = bs->cur->bc_mp;
-	xfs_agnumber_t			agno = bs->cur->bc_private.a.agno;
+	xfs_agnumber_t			agno = bs->cur->bc_ag.agno;
 	xfs_agblock_t			bno;
 
 	bno = XFS_AGINO_TO_AGBNO(mp, agino);
@@ -164,7 +164,7 @@ xchk_iallocbt_check_cluster_ifree(
 	 * the record, compute which fs inode we're talking about.
 	 */
 	agino = irec->ir_startino + irec_ino;
-	fsino = XFS_AGINO_TO_INO(mp, bs->cur->bc_private.a.agno, agino);
+	fsino = XFS_AGINO_TO_INO(mp, bs->cur->bc_ag.agno, agino);
 	irec_free = (irec->ir_free & XFS_INOBT_MASK(irec_ino));
 
 	if (be16_to_cpu(dip->di_magic) != XFS_DINODE_MAGIC ||
@@ -215,7 +215,7 @@ xchk_iallocbt_check_cluster(
 	struct xfs_dinode		*dip;
 	struct xfs_buf			*cluster_bp;
 	unsigned int			nr_inodes;
-	xfs_agnumber_t			agno = bs->cur->bc_private.a.agno;
+	xfs_agnumber_t			agno = bs->cur->bc_ag.agno;
 	xfs_agblock_t			agbno;
 	unsigned int			cluster_index;
 	uint16_t			cluster_mask = 0;
@@ -426,7 +426,7 @@ xchk_iallocbt_rec(
 	struct xchk_iallocbt		*iabt = bs->private;
 	struct xfs_inobt_rec_incore	irec;
 	uint64_t			holes;
-	xfs_agnumber_t			agno = bs->cur->bc_private.a.agno;
+	xfs_agnumber_t			agno = bs->cur->bc_ag.agno;
 	xfs_agino_t			agino;
 	xfs_extlen_t			len;
 	int				holecount;
diff --git a/fs/xfs/scrub/refcount.c b/fs/xfs/scrub/refcount.c
index 0cab11a5d390..beaeb6fa3119 100644
--- a/fs/xfs/scrub/refcount.c
+++ b/fs/xfs/scrub/refcount.c
@@ -336,7 +336,7 @@ xchk_refcountbt_rec(
 {
 	struct xfs_mount	*mp = bs->cur->bc_mp;
 	xfs_agblock_t		*cow_blocks = bs->private;
-	xfs_agnumber_t		agno = bs->cur->bc_private.a.agno;
+	xfs_agnumber_t		agno = bs->cur->bc_ag.agno;
 	xfs_agblock_t		bno;
 	xfs_extlen_t		len;
 	xfs_nlink_t		refcount;
diff --git a/fs/xfs/scrub/rmap.c b/fs/xfs/scrub/rmap.c
index 8d4cefd761c1..f4fcb4719f41 100644
--- a/fs/xfs/scrub/rmap.c
+++ b/fs/xfs/scrub/rmap.c
@@ -92,7 +92,7 @@ xchk_rmapbt_rec(
 {
 	struct xfs_mount	*mp = bs->cur->bc_mp;
 	struct xfs_rmap_irec	irec;
-	xfs_agnumber_t		agno = bs->cur->bc_private.a.agno;
+	xfs_agnumber_t		agno = bs->cur->bc_ag.agno;
 	bool			non_inode;
 	bool			is_unwritten;
 	bool			is_bmbt;
diff --git a/fs/xfs/scrub/trace.c b/fs/xfs/scrub/trace.c
index 9eaab2eb5ed3..731111e1448c 100644
--- a/fs/xfs/scrub/trace.c
+++ b/fs/xfs/scrub/trace.c
@@ -26,7 +26,7 @@ xchk_btree_cur_fsbno(
 		 cur->bc_flags & XFS_BTREE_LONG_PTRS)
 		return XFS_INO_TO_FSB(cur->bc_mp, cur->bc_private.b.ip->i_ino);
 	else if (!(cur->bc_flags & XFS_BTREE_LONG_PTRS))
-		return XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno, 0);
+		return XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_ag.agno, 0);
 	return NULLFSBLOCK;
 }
 
diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c
index 918456ca29e1..910ad46e2bba 100644
--- a/fs/xfs/xfs_fsmap.c
+++ b/fs/xfs/xfs_fsmap.c
@@ -344,7 +344,7 @@ xfs_getfsmap_datadev_helper(
 	xfs_fsblock_t			fsb;
 	xfs_daddr_t			rec_daddr;
 
-	fsb = XFS_AGB_TO_FSB(mp, cur->bc_private.a.agno, rec->rm_startblock);
+	fsb = XFS_AGB_TO_FSB(mp, cur->bc_ag.agno, rec->rm_startblock);
 	rec_daddr = XFS_FSB_TO_DADDR(mp, fsb);
 
 	return xfs_getfsmap_helper(cur->bc_tp, info, rec, rec_daddr);
@@ -362,7 +362,7 @@ xfs_getfsmap_datadev_bnobt_helper(
 	struct xfs_rmap_irec		irec;
 	xfs_daddr_t			rec_daddr;
 
-	rec_daddr = XFS_AGB_TO_DADDR(mp, cur->bc_private.a.agno,
+	rec_daddr = XFS_AGB_TO_DADDR(mp, cur->bc_ag.agno,
 			rec->ar_startblock);
 
 	irec.rm_startblock = rec->ar_startblock;


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 3/7] xfs: convert btree cursor inode-private member names
  2020-03-12  3:44 [PATCH v2 0/7] xfs: make btree cursor private unions anonymous Darrick J. Wong
  2020-03-12  3:44 ` [PATCH 1/7] xfs: introduce new private btree cursor names Darrick J. Wong
  2020-03-12  3:44 ` [PATCH 2/7] xfs: convert btree cursor ag-private member name Darrick J. Wong
@ 2020-03-12  3:45 ` Darrick J. Wong
  2020-03-12 10:42   ` Brian Foster
  2020-03-12  3:45 ` [PATCH 4/7] xfs: rename btree cursor private btree member flags Darrick J. Wong
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 17+ messages in thread
From: Darrick J. Wong @ 2020-03-12  3:45 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, david, Dave Chinner

From: Dave Chinner <dchinner@redhat.com>

bc_private.b -> bc_ino conversion via script:

$ sed -i 's/bc_private\.b/bc_ino/g' fs/xfs/*[ch] fs/xfs/*/*[ch]

And then revert the change to the bc_ino #define in
fs/xfs/libxfs/xfs_btree.h manually.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[darrick: tweak the subject line slightly]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_bmap.c       |   44 ++++++++++++++++++-----------------
 fs/xfs/libxfs/xfs_bmap_btree.c |   50 ++++++++++++++++++++--------------------
 fs/xfs/libxfs/xfs_btree.c      |   50 ++++++++++++++++++++--------------------
 fs/xfs/scrub/bmap.c            |    2 +-
 fs/xfs/scrub/trace.c           |    2 +-
 fs/xfs/scrub/trace.h           |    4 ++-
 6 files changed, 76 insertions(+), 76 deletions(-)


diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 43ae2ab21084..fc8f6d65576c 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -690,7 +690,7 @@ xfs_bmap_extents_to_btree(
 	 * Need a cursor.  Can't allocate until bb_level is filled in.
 	 */
 	cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
-	cur->bc_private.b.flags = wasdel ? XFS_BTCUR_BPRV_WASDEL : 0;
+	cur->bc_ino.flags = wasdel ? XFS_BTCUR_BPRV_WASDEL : 0;
 	/*
 	 * Convert to a btree with two levels, one record in root.
 	 */
@@ -727,7 +727,7 @@ xfs_bmap_extents_to_btree(
 	ASSERT(tp->t_firstblock == NULLFSBLOCK ||
 	       args.agno >= XFS_FSB_TO_AGNO(mp, tp->t_firstblock));
 	tp->t_firstblock = args.fsbno;
-	cur->bc_private.b.allocated++;
+	cur->bc_ino.allocated++;
 	ip->i_d.di_nblocks++;
 	xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, 1L);
 	error = xfs_trans_get_buf(tp, mp->m_ddev_targp,
@@ -953,7 +953,7 @@ xfs_bmap_add_attrfork_btree(
 			xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
 			return -ENOSPC;
 		}
-		cur->bc_private.b.allocated = 0;
+		cur->bc_ino.allocated = 0;
 		xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
 	}
 	return 0;
@@ -980,7 +980,7 @@ xfs_bmap_add_attrfork_extents(
 	error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0, flags,
 					  XFS_DATA_FORK);
 	if (cur) {
-		cur->bc_private.b.allocated = 0;
+		cur->bc_ino.allocated = 0;
 		xfs_btree_del_cursor(cur, error);
 	}
 	return error;
@@ -1178,13 +1178,13 @@ xfs_iread_bmbt_block(
 {
 	struct xfs_iread_state	*ir = priv;
 	struct xfs_mount	*mp = cur->bc_mp;
-	struct xfs_inode	*ip = cur->bc_private.b.ip;
+	struct xfs_inode	*ip = cur->bc_ino.ip;
 	struct xfs_btree_block	*block;
 	struct xfs_buf		*bp;
 	struct xfs_bmbt_rec	*frp;
 	xfs_extnum_t		num_recs;
 	xfs_extnum_t		j;
-	int			whichfork = cur->bc_private.b.whichfork;
+	int			whichfork = cur->bc_ino.whichfork;
 
 	block = xfs_btree_get_block(cur, level, &bp);
 
@@ -1528,7 +1528,7 @@ xfs_bmap_add_extent_delay_real(
 
 	ASSERT(!isnullstartblock(new->br_startblock));
 	ASSERT(!bma->cur ||
-	       (bma->cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL));
+	       (bma->cur->bc_ino.flags & XFS_BTCUR_BPRV_WASDEL));
 
 	XFS_STATS_INC(mp, xs_add_exlist);
 
@@ -1818,7 +1818,7 @@ xfs_bmap_add_extent_delay_real(
 		temp = PREV.br_blockcount - new->br_blockcount;
 		da_new = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(bma->ip, temp),
 			startblockval(PREV.br_startblock) -
-			(bma->cur ? bma->cur->bc_private.b.allocated : 0));
+			(bma->cur ? bma->cur->bc_ino.allocated : 0));
 
 		PREV.br_startoff = new_endoff;
 		PREV.br_blockcount = temp;
@@ -1904,7 +1904,7 @@ xfs_bmap_add_extent_delay_real(
 		temp = PREV.br_blockcount - new->br_blockcount;
 		da_new = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(bma->ip, temp),
 			startblockval(PREV.br_startblock) -
-			(bma->cur ? bma->cur->bc_private.b.allocated : 0));
+			(bma->cur ? bma->cur->bc_ino.allocated : 0));
 
 		PREV.br_startblock = nullstartblock(da_new);
 		PREV.br_blockcount = temp;
@@ -2025,8 +2025,8 @@ xfs_bmap_add_extent_delay_real(
 		xfs_mod_delalloc(mp, (int64_t)da_new - da_old);
 
 	if (bma->cur) {
-		da_new += bma->cur->bc_private.b.allocated;
-		bma->cur->bc_private.b.allocated = 0;
+		da_new += bma->cur->bc_ino.allocated;
+		bma->cur->bc_ino.allocated = 0;
 	}
 
 	/* adjust for changes in reserved delayed indirect blocks */
@@ -2573,7 +2573,7 @@ xfs_bmap_add_extent_unwritten_real(
 
 	/* clear out the allocated field, done with it now in any case. */
 	if (cur) {
-		cur->bc_private.b.allocated = 0;
+		cur->bc_ino.allocated = 0;
 		*curp = cur;
 	}
 
@@ -2752,7 +2752,7 @@ xfs_bmap_add_extent_hole_real(
 	struct xfs_bmbt_irec	old;
 
 	ASSERT(!isnullstartblock(new->br_startblock));
-	ASSERT(!cur || !(cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL));
+	ASSERT(!cur || !(cur->bc_ino.flags & XFS_BTCUR_BPRV_WASDEL));
 
 	XFS_STATS_INC(mp, xs_add_exlist);
 
@@ -2955,7 +2955,7 @@ xfs_bmap_add_extent_hole_real(
 
 	/* clear out the allocated field, done with it now in any case. */
 	if (cur)
-		cur->bc_private.b.allocated = 0;
+		cur->bc_ino.allocated = 0;
 
 	xfs_bmap_check_leaf_extents(cur, ip, whichfork);
 done:
@@ -4187,7 +4187,7 @@ xfs_bmapi_allocate(
 	bma->nallocs++;
 
 	if (bma->cur)
-		bma->cur->bc_private.b.flags =
+		bma->cur->bc_ino.flags =
 			bma->wasdel ? XFS_BTCUR_BPRV_WASDEL : 0;
 
 	bma->got.br_startoff = bma->offset;
@@ -4709,7 +4709,7 @@ xfs_bmapi_remap(
 
 	if (ifp->if_flags & XFS_IFBROOT) {
 		cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
-		cur->bc_private.b.flags = 0;
+		cur->bc_ino.flags = 0;
 	}
 
 	got.br_startoff = bno;
@@ -5364,7 +5364,7 @@ __xfs_bunmapi(
 	if (ifp->if_flags & XFS_IFBROOT) {
 		ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE);
 		cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
-		cur->bc_private.b.flags = 0;
+		cur->bc_ino.flags = 0;
 	} else
 		cur = NULL;
 
@@ -5620,7 +5620,7 @@ __xfs_bunmapi(
 		xfs_trans_log_inode(tp, ip, logflags);
 	if (cur) {
 		if (!error)
-			cur->bc_private.b.allocated = 0;
+			cur->bc_ino.allocated = 0;
 		xfs_btree_del_cursor(cur, error);
 	}
 	return error;
@@ -5839,7 +5839,7 @@ xfs_bmap_collapse_extents(
 
 	if (ifp->if_flags & XFS_IFBROOT) {
 		cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
-		cur->bc_private.b.flags = 0;
+		cur->bc_ino.flags = 0;
 	}
 
 	if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) {
@@ -5956,7 +5956,7 @@ xfs_bmap_insert_extents(
 
 	if (ifp->if_flags & XFS_IFBROOT) {
 		cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
-		cur->bc_private.b.flags = 0;
+		cur->bc_ino.flags = 0;
 	}
 
 	if (*next_fsb == NULLFSBLOCK) {
@@ -6074,7 +6074,7 @@ xfs_bmap_split_extent(
 
 	if (ifp->if_flags & XFS_IFBROOT) {
 		cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
-		cur->bc_private.b.flags = 0;
+		cur->bc_ino.flags = 0;
 		error = xfs_bmbt_lookup_eq(cur, &got, &i);
 		if (error)
 			goto del_cursor;
@@ -6133,7 +6133,7 @@ xfs_bmap_split_extent(
 
 del_cursor:
 	if (cur) {
-		cur->bc_private.b.allocated = 0;
+		cur->bc_ino.allocated = 0;
 		xfs_btree_del_cursor(cur, error);
 	}
 
diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c
index ffe608d2a2d9..71b60f2a9979 100644
--- a/fs/xfs/libxfs/xfs_bmap_btree.c
+++ b/fs/xfs/libxfs/xfs_bmap_btree.c
@@ -166,13 +166,13 @@ xfs_bmbt_dup_cursor(
 	struct xfs_btree_cur	*new;
 
 	new = xfs_bmbt_init_cursor(cur->bc_mp, cur->bc_tp,
-			cur->bc_private.b.ip, cur->bc_private.b.whichfork);
+			cur->bc_ino.ip, cur->bc_ino.whichfork);
 
 	/*
 	 * Copy the firstblock, dfops, and flags values,
 	 * since init cursor doesn't get them.
 	 */
-	new->bc_private.b.flags = cur->bc_private.b.flags;
+	new->bc_ino.flags = cur->bc_ino.flags;
 
 	return new;
 }
@@ -183,12 +183,12 @@ xfs_bmbt_update_cursor(
 	struct xfs_btree_cur	*dst)
 {
 	ASSERT((dst->bc_tp->t_firstblock != NULLFSBLOCK) ||
-	       (dst->bc_private.b.ip->i_d.di_flags & XFS_DIFLAG_REALTIME));
+	       (dst->bc_ino.ip->i_d.di_flags & XFS_DIFLAG_REALTIME));
 
-	dst->bc_private.b.allocated += src->bc_private.b.allocated;
+	dst->bc_ino.allocated += src->bc_ino.allocated;
 	dst->bc_tp->t_firstblock = src->bc_tp->t_firstblock;
 
-	src->bc_private.b.allocated = 0;
+	src->bc_ino.allocated = 0;
 }
 
 STATIC int
@@ -205,8 +205,8 @@ xfs_bmbt_alloc_block(
 	args.tp = cur->bc_tp;
 	args.mp = cur->bc_mp;
 	args.fsbno = cur->bc_tp->t_firstblock;
-	xfs_rmap_ino_bmbt_owner(&args.oinfo, cur->bc_private.b.ip->i_ino,
-			cur->bc_private.b.whichfork);
+	xfs_rmap_ino_bmbt_owner(&args.oinfo, cur->bc_ino.ip->i_ino,
+			cur->bc_ino.whichfork);
 
 	if (args.fsbno == NULLFSBLOCK) {
 		args.fsbno = be64_to_cpu(start->l);
@@ -230,7 +230,7 @@ xfs_bmbt_alloc_block(
 	}
 
 	args.minlen = args.maxlen = args.prod = 1;
-	args.wasdel = cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL;
+	args.wasdel = cur->bc_ino.flags & XFS_BTCUR_BPRV_WASDEL;
 	if (!args.wasdel && args.tp->t_blk_res == 0) {
 		error = -ENOSPC;
 		goto error0;
@@ -259,10 +259,10 @@ xfs_bmbt_alloc_block(
 
 	ASSERT(args.len == 1);
 	cur->bc_tp->t_firstblock = args.fsbno;
-	cur->bc_private.b.allocated++;
-	cur->bc_private.b.ip->i_d.di_nblocks++;
-	xfs_trans_log_inode(args.tp, cur->bc_private.b.ip, XFS_ILOG_CORE);
-	xfs_trans_mod_dquot_byino(args.tp, cur->bc_private.b.ip,
+	cur->bc_ino.allocated++;
+	cur->bc_ino.ip->i_d.di_nblocks++;
+	xfs_trans_log_inode(args.tp, cur->bc_ino.ip, XFS_ILOG_CORE);
+	xfs_trans_mod_dquot_byino(args.tp, cur->bc_ino.ip,
 			XFS_TRANS_DQ_BCOUNT, 1L);
 
 	new->l = cpu_to_be64(args.fsbno);
@@ -280,12 +280,12 @@ xfs_bmbt_free_block(
 	struct xfs_buf		*bp)
 {
 	struct xfs_mount	*mp = cur->bc_mp;
-	struct xfs_inode	*ip = cur->bc_private.b.ip;
+	struct xfs_inode	*ip = cur->bc_ino.ip;
 	struct xfs_trans	*tp = cur->bc_tp;
 	xfs_fsblock_t		fsbno = XFS_DADDR_TO_FSB(mp, XFS_BUF_ADDR(bp));
 	struct xfs_owner_info	oinfo;
 
-	xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_private.b.whichfork);
+	xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_ino.whichfork);
 	xfs_bmap_add_free(cur->bc_tp, fsbno, 1, &oinfo);
 	ip->i_d.di_nblocks--;
 
@@ -302,8 +302,8 @@ xfs_bmbt_get_minrecs(
 	if (level == cur->bc_nlevels - 1) {
 		struct xfs_ifork	*ifp;
 
-		ifp = XFS_IFORK_PTR(cur->bc_private.b.ip,
-				    cur->bc_private.b.whichfork);
+		ifp = XFS_IFORK_PTR(cur->bc_ino.ip,
+				    cur->bc_ino.whichfork);
 
 		return xfs_bmbt_maxrecs(cur->bc_mp,
 					ifp->if_broot_bytes, level == 0) / 2;
@@ -320,8 +320,8 @@ xfs_bmbt_get_maxrecs(
 	if (level == cur->bc_nlevels - 1) {
 		struct xfs_ifork	*ifp;
 
-		ifp = XFS_IFORK_PTR(cur->bc_private.b.ip,
-				    cur->bc_private.b.whichfork);
+		ifp = XFS_IFORK_PTR(cur->bc_ino.ip,
+				    cur->bc_ino.whichfork);
 
 		return xfs_bmbt_maxrecs(cur->bc_mp,
 					ifp->if_broot_bytes, level == 0);
@@ -347,7 +347,7 @@ xfs_bmbt_get_dmaxrecs(
 {
 	if (level != cur->bc_nlevels - 1)
 		return cur->bc_mp->m_bmap_dmxr[level != 0];
-	return xfs_bmdr_maxrecs(cur->bc_private.b.forksize, level == 0);
+	return xfs_bmdr_maxrecs(cur->bc_ino.forksize, level == 0);
 }
 
 STATIC void
@@ -566,11 +566,11 @@ xfs_bmbt_init_cursor(
 	if (xfs_sb_version_hascrc(&mp->m_sb))
 		cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
 
-	cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork);
-	cur->bc_private.b.ip = ip;
-	cur->bc_private.b.allocated = 0;
-	cur->bc_private.b.flags = 0;
-	cur->bc_private.b.whichfork = whichfork;
+	cur->bc_ino.forksize = XFS_IFORK_SIZE(ip, whichfork);
+	cur->bc_ino.ip = ip;
+	cur->bc_ino.allocated = 0;
+	cur->bc_ino.flags = 0;
+	cur->bc_ino.whichfork = whichfork;
 
 	return cur;
 }
@@ -644,7 +644,7 @@ xfs_bmbt_change_owner(
 	cur = xfs_bmbt_init_cursor(ip->i_mount, tp, ip, whichfork);
 	if (!cur)
 		return -ENOMEM;
-	cur->bc_private.b.flags |= XFS_BTCUR_BPRV_INVALID_OWNER;
+	cur->bc_ino.flags |= XFS_BTCUR_BPRV_INVALID_OWNER;
 
 	error = xfs_btree_change_owner(cur, new_owner, buffer_list);
 	xfs_btree_del_cursor(cur, error);
diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
index 7681d48a2b13..8c6e128c8ae8 100644
--- a/fs/xfs/libxfs/xfs_btree.c
+++ b/fs/xfs/libxfs/xfs_btree.c
@@ -234,8 +234,8 @@ xfs_btree_check_ptr(
 			return 0;
 		xfs_err(cur->bc_mp,
 "Inode %llu fork %d: Corrupt btree %d pointer at level %d index %d.",
-				cur->bc_private.b.ip->i_ino,
-				cur->bc_private.b.whichfork, cur->bc_btnum,
+				cur->bc_ino.ip->i_ino,
+				cur->bc_ino.whichfork, cur->bc_btnum,
 				level, index);
 	} else {
 		if (xfs_btree_check_sptr(cur, be32_to_cpu((&ptr->s)[index]),
@@ -378,7 +378,7 @@ xfs_btree_del_cursor(
 	 * allocated indirect blocks' accounting.
 	 */
 	ASSERT(cur->bc_btnum != XFS_BTNUM_BMAP ||
-	       cur->bc_private.b.allocated == 0);
+	       cur->bc_ino.allocated == 0);
 	/*
 	 * Free the cursor.
 	 */
@@ -654,7 +654,7 @@ xfs_btree_get_iroot(
 {
 	struct xfs_ifork	*ifp;
 
-	ifp = XFS_IFORK_PTR(cur->bc_private.b.ip, cur->bc_private.b.whichfork);
+	ifp = XFS_IFORK_PTR(cur->bc_ino.ip, cur->bc_ino.whichfork);
 	return (struct xfs_btree_block *)ifp->if_broot;
 }
 
@@ -1144,7 +1144,7 @@ xfs_btree_init_block_cur(
 	 * code.
 	 */
 	if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
-		owner = cur->bc_private.b.ip->i_ino;
+		owner = cur->bc_ino.ip->i_ino;
 	else
 		owner = cur->bc_ag.agno;
 
@@ -1393,8 +1393,8 @@ xfs_btree_log_keys(
 				  xfs_btree_key_offset(cur, first),
 				  xfs_btree_key_offset(cur, last + 1) - 1);
 	} else {
-		xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip,
-				xfs_ilog_fbroot(cur->bc_private.b.whichfork));
+		xfs_trans_log_inode(cur->bc_tp, cur->bc_ino.ip,
+				xfs_ilog_fbroot(cur->bc_ino.whichfork));
 	}
 }
 
@@ -1436,8 +1436,8 @@ xfs_btree_log_ptrs(
 				xfs_btree_ptr_offset(cur, first, level),
 				xfs_btree_ptr_offset(cur, last + 1, level) - 1);
 	} else {
-		xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip,
-			xfs_ilog_fbroot(cur->bc_private.b.whichfork));
+		xfs_trans_log_inode(cur->bc_tp, cur->bc_ino.ip,
+			xfs_ilog_fbroot(cur->bc_ino.whichfork));
 	}
 
 }
@@ -1505,8 +1505,8 @@ xfs_btree_log_block(
 		xfs_trans_buf_set_type(cur->bc_tp, bp, XFS_BLFT_BTREE_BUF);
 		xfs_trans_log_buf(cur->bc_tp, bp, first, last);
 	} else {
-		xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip,
-			xfs_ilog_fbroot(cur->bc_private.b.whichfork));
+		xfs_trans_log_inode(cur->bc_tp, cur->bc_ino.ip,
+			xfs_ilog_fbroot(cur->bc_ino.whichfork));
 	}
 }
 
@@ -1743,10 +1743,10 @@ xfs_btree_lookup_get_block(
 
 	/* Check the inode owner since the verifiers don't. */
 	if (xfs_sb_version_hascrc(&cur->bc_mp->m_sb) &&
-	    !(cur->bc_private.b.flags & XFS_BTCUR_BPRV_INVALID_OWNER) &&
+	    !(cur->bc_ino.flags & XFS_BTCUR_BPRV_INVALID_OWNER) &&
 	    (cur->bc_flags & XFS_BTREE_LONG_PTRS) &&
 	    be64_to_cpu((*blkp)->bb_u.l.bb_owner) !=
-			cur->bc_private.b.ip->i_ino)
+			cur->bc_ino.ip->i_ino)
 		goto out_bad;
 
 	/* Did we get the level we were looking for? */
@@ -2938,9 +2938,9 @@ xfs_btree_new_iroot(
 
 	xfs_btree_copy_ptrs(cur, pp, &nptr, 1);
 
-	xfs_iroot_realloc(cur->bc_private.b.ip,
+	xfs_iroot_realloc(cur->bc_ino.ip,
 			  1 - xfs_btree_get_numrecs(cblock),
-			  cur->bc_private.b.whichfork);
+			  cur->bc_ino.whichfork);
 
 	xfs_btree_setbuf(cur, level, cbp);
 
@@ -2953,7 +2953,7 @@ xfs_btree_new_iroot(
 	xfs_btree_log_ptrs(cur, cbp, 1, be16_to_cpu(cblock->bb_numrecs));
 
 	*logflags |=
-		XFS_ILOG_CORE | xfs_ilog_fbroot(cur->bc_private.b.whichfork);
+		XFS_ILOG_CORE | xfs_ilog_fbroot(cur->bc_ino.whichfork);
 	*stat = 1;
 	return 0;
 error0:
@@ -3105,11 +3105,11 @@ xfs_btree_make_block_unfull(
 
 	if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) &&
 	    level == cur->bc_nlevels - 1) {
-		struct xfs_inode *ip = cur->bc_private.b.ip;
+		struct xfs_inode *ip = cur->bc_ino.ip;
 
 		if (numrecs < cur->bc_ops->get_dmaxrecs(cur, level)) {
 			/* A root block that can be made bigger. */
-			xfs_iroot_realloc(ip, 1, cur->bc_private.b.whichfork);
+			xfs_iroot_realloc(ip, 1, cur->bc_ino.whichfork);
 			*stat = 1;
 		} else {
 			/* A root block that needs replacing */
@@ -3455,8 +3455,8 @@ STATIC int
 xfs_btree_kill_iroot(
 	struct xfs_btree_cur	*cur)
 {
-	int			whichfork = cur->bc_private.b.whichfork;
-	struct xfs_inode	*ip = cur->bc_private.b.ip;
+	int			whichfork = cur->bc_ino.whichfork;
+	struct xfs_inode	*ip = cur->bc_ino.ip;
 	struct xfs_ifork	*ifp = XFS_IFORK_PTR(ip, whichfork);
 	struct xfs_btree_block	*block;
 	struct xfs_btree_block	*cblock;
@@ -3514,8 +3514,8 @@ xfs_btree_kill_iroot(
 
 	index = numrecs - cur->bc_ops->get_maxrecs(cur, level);
 	if (index) {
-		xfs_iroot_realloc(cur->bc_private.b.ip, index,
-				  cur->bc_private.b.whichfork);
+		xfs_iroot_realloc(cur->bc_ino.ip, index,
+				  cur->bc_ino.whichfork);
 		block = ifp->if_broot;
 	}
 
@@ -3544,7 +3544,7 @@ xfs_btree_kill_iroot(
 	cur->bc_bufs[level - 1] = NULL;
 	be16_add_cpu(&block->bb_level, -1);
 	xfs_trans_log_inode(cur->bc_tp, ip,
-		XFS_ILOG_CORE | xfs_ilog_fbroot(cur->bc_private.b.whichfork));
+		XFS_ILOG_CORE | xfs_ilog_fbroot(cur->bc_ino.whichfork));
 	cur->bc_nlevels--;
 out0:
 	return 0;
@@ -3712,8 +3712,8 @@ xfs_btree_delrec(
 	 */
 	if (level == cur->bc_nlevels - 1) {
 		if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) {
-			xfs_iroot_realloc(cur->bc_private.b.ip, -1,
-					  cur->bc_private.b.whichfork);
+			xfs_iroot_realloc(cur->bc_ino.ip, -1,
+					  cur->bc_ino.whichfork);
 
 			error = xfs_btree_kill_iroot(cur);
 			if (error)
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
index 1c866594ec34..add8598eacd5 100644
--- a/fs/xfs/scrub/bmap.c
+++ b/fs/xfs/scrub/bmap.c
@@ -374,7 +374,7 @@ xchk_bmapbt_rec(
 	struct xfs_bmbt_irec	iext_irec;
 	struct xfs_iext_cursor	icur;
 	struct xchk_bmap_info	*info = bs->private;
-	struct xfs_inode	*ip = bs->cur->bc_private.b.ip;
+	struct xfs_inode	*ip = bs->cur->bc_ino.ip;
 	struct xfs_buf		*bp = NULL;
 	struct xfs_btree_block	*block;
 	struct xfs_ifork	*ifp = XFS_IFORK_PTR(ip, info->whichfork);
diff --git a/fs/xfs/scrub/trace.c b/fs/xfs/scrub/trace.c
index 731111e1448c..2c6c248be823 100644
--- a/fs/xfs/scrub/trace.c
+++ b/fs/xfs/scrub/trace.c
@@ -24,7 +24,7 @@ xchk_btree_cur_fsbno(
 		return XFS_DADDR_TO_FSB(cur->bc_mp, cur->bc_bufs[level]->b_bn);
 	else if (level == cur->bc_nlevels - 1 &&
 		 cur->bc_flags & XFS_BTREE_LONG_PTRS)
-		return XFS_INO_TO_FSB(cur->bc_mp, cur->bc_private.b.ip->i_ino);
+		return XFS_INO_TO_FSB(cur->bc_mp, cur->bc_ino.ip->i_ino);
 	else if (!(cur->bc_flags & XFS_BTREE_LONG_PTRS))
 		return XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_ag.agno, 0);
 	return NULLFSBLOCK;
diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
index 096203119934..e46f5cef90da 100644
--- a/fs/xfs/scrub/trace.h
+++ b/fs/xfs/scrub/trace.h
@@ -379,7 +379,7 @@ TRACE_EVENT(xchk_ifork_btree_op_error,
 		xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
 		__entry->dev = sc->mp->m_super->s_dev;
 		__entry->ino = sc->ip->i_ino;
-		__entry->whichfork = cur->bc_private.b.whichfork;
+		__entry->whichfork = cur->bc_ino.whichfork;
 		__entry->type = sc->sm->sm_type;
 		__entry->btnum = cur->bc_btnum;
 		__entry->level = level;
@@ -459,7 +459,7 @@ TRACE_EVENT(xchk_ifork_btree_error,
 		xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
 		__entry->dev = sc->mp->m_super->s_dev;
 		__entry->ino = sc->ip->i_ino;
-		__entry->whichfork = cur->bc_private.b.whichfork;
+		__entry->whichfork = cur->bc_ino.whichfork;
 		__entry->type = sc->sm->sm_type;
 		__entry->btnum = cur->bc_btnum;
 		__entry->level = level;


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 4/7] xfs: rename btree cursor private btree member flags
  2020-03-12  3:44 [PATCH v2 0/7] xfs: make btree cursor private unions anonymous Darrick J. Wong
                   ` (2 preceding siblings ...)
  2020-03-12  3:45 ` [PATCH 3/7] xfs: convert btree cursor inode-private member names Darrick J. Wong
@ 2020-03-12  3:45 ` Darrick J. Wong
  2020-03-12 10:42   ` Brian Foster
  2020-03-12  3:45 ` [PATCH 5/7] xfs: make btree cursor private union anonymous Darrick J. Wong
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 17+ messages in thread
From: Darrick J. Wong @ 2020-03-12  3:45 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, david, Dave Chinner

From: Dave Chinner <dchinner@redhat.com>

BPRV is not longer appropriate because bc_private is going away.
Script:

$ sed -i 's/BTCUR_BPRV/BTCUR_BMBT/g' fs/xfs/*[ch] fs/xfs/*/*[ch]

With manual cleanup to the definitions in fs/xfs/libxfs/xfs_btree.h

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[darrick: change "BC_BT" to "BTCUR_BMBT", fix subject line typo]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_bmap.c       |    8 ++++----
 fs/xfs/libxfs/xfs_bmap_btree.c |    4 ++--
 fs/xfs/libxfs/xfs_btree.c      |    2 +-
 fs/xfs/libxfs/xfs_btree.h      |    4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)


diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index fc8f6d65576c..8057486c02b5 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -690,7 +690,7 @@ xfs_bmap_extents_to_btree(
 	 * Need a cursor.  Can't allocate until bb_level is filled in.
 	 */
 	cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
-	cur->bc_ino.flags = wasdel ? XFS_BTCUR_BPRV_WASDEL : 0;
+	cur->bc_ino.flags = wasdel ? XFS_BTCUR_BMBT_WASDEL : 0;
 	/*
 	 * Convert to a btree with two levels, one record in root.
 	 */
@@ -1528,7 +1528,7 @@ xfs_bmap_add_extent_delay_real(
 
 	ASSERT(!isnullstartblock(new->br_startblock));
 	ASSERT(!bma->cur ||
-	       (bma->cur->bc_ino.flags & XFS_BTCUR_BPRV_WASDEL));
+	       (bma->cur->bc_ino.flags & XFS_BTCUR_BMBT_WASDEL));
 
 	XFS_STATS_INC(mp, xs_add_exlist);
 
@@ -2752,7 +2752,7 @@ xfs_bmap_add_extent_hole_real(
 	struct xfs_bmbt_irec	old;
 
 	ASSERT(!isnullstartblock(new->br_startblock));
-	ASSERT(!cur || !(cur->bc_ino.flags & XFS_BTCUR_BPRV_WASDEL));
+	ASSERT(!cur || !(cur->bc_ino.flags & XFS_BTCUR_BMBT_WASDEL));
 
 	XFS_STATS_INC(mp, xs_add_exlist);
 
@@ -4188,7 +4188,7 @@ xfs_bmapi_allocate(
 
 	if (bma->cur)
 		bma->cur->bc_ino.flags =
-			bma->wasdel ? XFS_BTCUR_BPRV_WASDEL : 0;
+			bma->wasdel ? XFS_BTCUR_BMBT_WASDEL : 0;
 
 	bma->got.br_startoff = bma->offset;
 	bma->got.br_startblock = bma->blkno;
diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c
index 71b60f2a9979..295a59cf8840 100644
--- a/fs/xfs/libxfs/xfs_bmap_btree.c
+++ b/fs/xfs/libxfs/xfs_bmap_btree.c
@@ -230,7 +230,7 @@ xfs_bmbt_alloc_block(
 	}
 
 	args.minlen = args.maxlen = args.prod = 1;
-	args.wasdel = cur->bc_ino.flags & XFS_BTCUR_BPRV_WASDEL;
+	args.wasdel = cur->bc_ino.flags & XFS_BTCUR_BMBT_WASDEL;
 	if (!args.wasdel && args.tp->t_blk_res == 0) {
 		error = -ENOSPC;
 		goto error0;
@@ -644,7 +644,7 @@ xfs_bmbt_change_owner(
 	cur = xfs_bmbt_init_cursor(ip->i_mount, tp, ip, whichfork);
 	if (!cur)
 		return -ENOMEM;
-	cur->bc_ino.flags |= XFS_BTCUR_BPRV_INVALID_OWNER;
+	cur->bc_ino.flags |= XFS_BTCUR_BMBT_INVALID_OWNER;
 
 	error = xfs_btree_change_owner(cur, new_owner, buffer_list);
 	xfs_btree_del_cursor(cur, error);
diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
index 8c6e128c8ae8..4ef9f0b42c7f 100644
--- a/fs/xfs/libxfs/xfs_btree.c
+++ b/fs/xfs/libxfs/xfs_btree.c
@@ -1743,7 +1743,7 @@ xfs_btree_lookup_get_block(
 
 	/* Check the inode owner since the verifiers don't. */
 	if (xfs_sb_version_hascrc(&cur->bc_mp->m_sb) &&
-	    !(cur->bc_ino.flags & XFS_BTCUR_BPRV_INVALID_OWNER) &&
+	    !(cur->bc_ino.flags & XFS_BTCUR_BMBT_INVALID_OWNER) &&
 	    (cur->bc_flags & XFS_BTREE_LONG_PTRS) &&
 	    be64_to_cpu((*blkp)->bb_u.l.bb_owner) !=
 			cur->bc_ino.ip->i_ino)
diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
index 4a1c98bdfaad..00a58ac8b696 100644
--- a/fs/xfs/libxfs/xfs_btree.h
+++ b/fs/xfs/libxfs/xfs_btree.h
@@ -220,8 +220,8 @@ typedef struct xfs_btree_cur
 			short		forksize;	/* fork's inode space */
 			char		whichfork;	/* data or attr fork */
 			char		flags;		/* flags */
-#define	XFS_BTCUR_BPRV_WASDEL		(1<<0)		/* was delayed */
-#define	XFS_BTCUR_BPRV_INVALID_OWNER	(1<<1)		/* for ext swap */
+#define	XFS_BTCUR_BMBT_WASDEL	(1 << 0)		/* was delayed */
+#define	XFS_BTCUR_BMBT_INVALID_OWNER	(1 << 1)		/* for ext swap */
 		} b;
 	}		bc_private;	/* per-btree type data */
 #define bc_ag	bc_private.a


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 5/7] xfs: make btree cursor private union anonymous
  2020-03-12  3:44 [PATCH v2 0/7] xfs: make btree cursor private unions anonymous Darrick J. Wong
                   ` (3 preceding siblings ...)
  2020-03-12  3:45 ` [PATCH 4/7] xfs: rename btree cursor private btree member flags Darrick J. Wong
@ 2020-03-12  3:45 ` Darrick J. Wong
  2020-03-12 10:49   ` Brian Foster
  2020-03-12  3:45 ` [PATCH 6/7] xfs: make the btree cursor union members named structure Darrick J. Wong
  2020-03-12  3:45 ` [PATCH 7/7] xfs: make the btree ag cursor private union anonymous Darrick J. Wong
  6 siblings, 1 reply; 17+ messages in thread
From: Darrick J. Wong @ 2020-03-12  3:45 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, david, Dave Chinner

From: Dave Chinner <dchinner@redhat.com>

Rename the union and it's internal structures to the new name and
remove the temporary defines that facilitated the change.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_btree.h |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)


diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
index 00a58ac8b696..12a2bc93371d 100644
--- a/fs/xfs/libxfs/xfs_btree.h
+++ b/fs/xfs/libxfs/xfs_btree.h
@@ -213,7 +213,7 @@ typedef struct xfs_btree_cur
 			struct xfs_buf	*agbp;	/* agf/agi buffer pointer */
 			xfs_agnumber_t	agno;	/* ag number */
 			union xfs_btree_cur_private	priv;
-		} a;
+		} bc_ag;
 		struct {			/* needed for BMAP */
 			struct xfs_inode *ip;	/* pointer to our inode */
 			int		allocated;	/* count of alloced */
@@ -222,10 +222,8 @@ typedef struct xfs_btree_cur
 			char		flags;		/* flags */
 #define	XFS_BTCUR_BMBT_WASDEL	(1 << 0)		/* was delayed */
 #define	XFS_BTCUR_BMBT_INVALID_OWNER	(1 << 1)		/* for ext swap */
-		} b;
-	}		bc_private;	/* per-btree type data */
-#define bc_ag	bc_private.a
-#define bc_ino	bc_private.b
+		} bc_ino;
+	};				/* per-btree type data */
 } xfs_btree_cur_t;
 
 /* cursor flags */


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 6/7] xfs: make the btree cursor union members named structure
  2020-03-12  3:44 [PATCH v2 0/7] xfs: make btree cursor private unions anonymous Darrick J. Wong
                   ` (4 preceding siblings ...)
  2020-03-12  3:45 ` [PATCH 5/7] xfs: make btree cursor private union anonymous Darrick J. Wong
@ 2020-03-12  3:45 ` Darrick J. Wong
  2020-03-12 10:49   ` Brian Foster
  2020-03-12  3:45 ` [PATCH 7/7] xfs: make the btree ag cursor private union anonymous Darrick J. Wong
  6 siblings, 1 reply; 17+ messages in thread
From: Darrick J. Wong @ 2020-03-12  3:45 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, david, Dave Chinner

From: Dave Chinner <dchinner@redhat.com>

we need to name the btree cursor private structures to be able
to pull them out of the deeply nested structure definition they are
in now.

Based on code extracted from a patchset by Darrick Wong.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_btree.h |   36 +++++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 15 deletions(-)


diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
index 12a2bc93371d..9884f543eb51 100644
--- a/fs/xfs/libxfs/xfs_btree.h
+++ b/fs/xfs/libxfs/xfs_btree.h
@@ -188,6 +188,24 @@ union xfs_btree_cur_private {
 	} abt;
 };
 
+/* Per-AG btree information. */
+struct xfs_btree_cur_ag {
+	struct xfs_buf			*agbp;
+	xfs_agnumber_t			agno;
+	union xfs_btree_cur_private	priv;
+};
+
+/* Btree-in-inode cursor information */
+struct xfs_btree_cur_ino {
+	struct xfs_inode	*ip;
+	int			allocated;
+	short			forksize;
+	char			whichfork;
+	char			flags;
+#define	XFS_BTCUR_BMBT_WASDEL	(1 << 0)
+#define	XFS_BTCUR_BMBT_INVALID_OWNER	(1 << 1)
+};
+
 /*
  * Btree cursor structure.
  * This collects all information needed by the btree code in one place.
@@ -209,21 +227,9 @@ typedef struct xfs_btree_cur
 	xfs_btnum_t	bc_btnum;	/* identifies which btree type */
 	int		bc_statoff;	/* offset of btre stats array */
 	union {
-		struct {			/* needed for BNO, CNT, INO */
-			struct xfs_buf	*agbp;	/* agf/agi buffer pointer */
-			xfs_agnumber_t	agno;	/* ag number */
-			union xfs_btree_cur_private	priv;
-		} bc_ag;
-		struct {			/* needed for BMAP */
-			struct xfs_inode *ip;	/* pointer to our inode */
-			int		allocated;	/* count of alloced */
-			short		forksize;	/* fork's inode space */
-			char		whichfork;	/* data or attr fork */
-			char		flags;		/* flags */
-#define	XFS_BTCUR_BMBT_WASDEL	(1 << 0)		/* was delayed */
-#define	XFS_BTCUR_BMBT_INVALID_OWNER	(1 << 1)		/* for ext swap */
-		} bc_ino;
-	};				/* per-btree type data */
+		struct xfs_btree_cur_ag	bc_ag;
+		struct xfs_btree_cur_ino bc_ino;
+	};
 } xfs_btree_cur_t;
 
 /* cursor flags */


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 7/7] xfs: make the btree ag cursor private union anonymous
  2020-03-12  3:44 [PATCH v2 0/7] xfs: make btree cursor private unions anonymous Darrick J. Wong
                   ` (5 preceding siblings ...)
  2020-03-12  3:45 ` [PATCH 6/7] xfs: make the btree cursor union members named structure Darrick J. Wong
@ 2020-03-12  3:45 ` Darrick J. Wong
  2020-03-12 10:49   ` Brian Foster
  6 siblings, 1 reply; 17+ messages in thread
From: Darrick J. Wong @ 2020-03-12  3:45 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, david, Dave Chinner

From: Dave Chinner <dchinner@redhat.com>

This is much less widely used than the bc_private union was, so this
is done as a single patch. The named union xfs_btree_cur_private
goes away and is embedded into the struct xfs_btree_cur_ag as an
anonymous union, and the code is modified via this script:

$ sed -i 's/priv\.\([abt|refc]\)/\1/g' fs/xfs/*[ch] fs/xfs/*/*[ch]

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_alloc.c          |   14 +++++++-------
 fs/xfs/libxfs/xfs_alloc_btree.c    |    2 +-
 fs/xfs/libxfs/xfs_btree.h          |   25 +++++++++++--------------
 fs/xfs/libxfs/xfs_refcount.c       |   24 ++++++++++++------------
 fs/xfs/libxfs/xfs_refcount_btree.c |    4 ++--
 5 files changed, 33 insertions(+), 36 deletions(-)


diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index 10ed68dfef5d..337822115bbc 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -151,7 +151,7 @@ xfs_alloc_lookup_eq(
 	cur->bc_rec.a.ar_startblock = bno;
 	cur->bc_rec.a.ar_blockcount = len;
 	error = xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat);
-	cur->bc_ag.priv.abt.active = (*stat == 1);
+	cur->bc_ag.abt.active = (*stat == 1);
 	return error;
 }
 
@@ -171,7 +171,7 @@ xfs_alloc_lookup_ge(
 	cur->bc_rec.a.ar_startblock = bno;
 	cur->bc_rec.a.ar_blockcount = len;
 	error = xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat);
-	cur->bc_ag.priv.abt.active = (*stat == 1);
+	cur->bc_ag.abt.active = (*stat == 1);
 	return error;
 }
 
@@ -190,7 +190,7 @@ xfs_alloc_lookup_le(
 	cur->bc_rec.a.ar_startblock = bno;
 	cur->bc_rec.a.ar_blockcount = len;
 	error = xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat);
-	cur->bc_ag.priv.abt.active = (*stat == 1);
+	cur->bc_ag.abt.active = (*stat == 1);
 	return error;
 }
 
@@ -198,7 +198,7 @@ static inline bool
 xfs_alloc_cur_active(
 	struct xfs_btree_cur	*cur)
 {
-	return cur && cur->bc_ag.priv.abt.active;
+	return cur && cur->bc_ag.abt.active;
 }
 
 /*
@@ -908,7 +908,7 @@ xfs_alloc_cur_check(
 		deactivate = true;
 out:
 	if (deactivate)
-		cur->bc_ag.priv.abt.active = false;
+		cur->bc_ag.abt.active = false;
 	trace_xfs_alloc_cur_check(args->mp, cur->bc_btnum, bno, len, diff,
 				  *new);
 	return 0;
@@ -1352,7 +1352,7 @@ xfs_alloc_walk_iter(
 		if (error)
 			return error;
 		if (i == 0)
-			cur->bc_ag.priv.abt.active = false;
+			cur->bc_ag.abt.active = false;
 
 		if (count > 0)
 			count--;
@@ -1467,7 +1467,7 @@ xfs_alloc_ag_vextent_locality(
 		if (error)
 			return error;
 		if (i) {
-			acur->cnt->bc_ag.priv.abt.active = true;
+			acur->cnt->bc_ag.abt.active = true;
 			fbcur = acur->cnt;
 			fbinc = false;
 		}
diff --git a/fs/xfs/libxfs/xfs_alloc_btree.c b/fs/xfs/libxfs/xfs_alloc_btree.c
index 92d30c19519d..a28041fdf4c0 100644
--- a/fs/xfs/libxfs/xfs_alloc_btree.c
+++ b/fs/xfs/libxfs/xfs_alloc_btree.c
@@ -507,7 +507,7 @@ xfs_allocbt_init_cursor(
 
 	cur->bc_ag.agbp = agbp;
 	cur->bc_ag.agno = agno;
-	cur->bc_ag.priv.abt.active = false;
+	cur->bc_ag.abt.active = false;
 
 	if (xfs_sb_version_hascrc(&mp->m_sb))
 		cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
index 9884f543eb51..0d10bbd5223a 100644
--- a/fs/xfs/libxfs/xfs_btree.h
+++ b/fs/xfs/libxfs/xfs_btree.h
@@ -177,22 +177,19 @@ union xfs_btree_irec {
 	struct xfs_refcount_irec	rc;
 };
 
-/* Per-AG btree private information. */
-union xfs_btree_cur_private {
-	struct {
-		unsigned long	nr_ops;		/* # record updates */
-		int		shape_changes;	/* # of extent splits */
-	} refc;
-	struct {
-		bool		active;		/* allocation cursor state */
-	} abt;
-};
-
 /* Per-AG btree information. */
 struct xfs_btree_cur_ag {
-	struct xfs_buf			*agbp;
-	xfs_agnumber_t			agno;
-	union xfs_btree_cur_private	priv;
+	struct xfs_buf		*agbp;
+	xfs_agnumber_t		agno;
+	union {
+		struct {
+			unsigned long nr_ops;	/* # record updates */
+			int	shape_changes;	/* # of extent splits */
+		} refc;
+		struct {
+			bool	active;		/* allocation cursor state */
+		} abt;
+	};
 };
 
 /* Btree-in-inode cursor information */
diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
index ef3e706f1d94..2076627243b0 100644
--- a/fs/xfs/libxfs/xfs_refcount.c
+++ b/fs/xfs/libxfs/xfs_refcount.c
@@ -883,7 +883,7 @@ xfs_refcount_still_have_space(
 {
 	unsigned long			overhead;
 
-	overhead = cur->bc_ag.priv.refc.shape_changes *
+	overhead = cur->bc_ag.refc.shape_changes *
 			xfs_allocfree_log_count(cur->bc_mp, 1);
 	overhead *= cur->bc_mp->m_sb.sb_blocksize;
 
@@ -891,17 +891,17 @@ xfs_refcount_still_have_space(
 	 * Only allow 2 refcount extent updates per transaction if the
 	 * refcount continue update "error" has been injected.
 	 */
-	if (cur->bc_ag.priv.refc.nr_ops > 2 &&
+	if (cur->bc_ag.refc.nr_ops > 2 &&
 	    XFS_TEST_ERROR(false, cur->bc_mp,
 			XFS_ERRTAG_REFCOUNT_CONTINUE_UPDATE))
 		return false;
 
-	if (cur->bc_ag.priv.refc.nr_ops == 0)
+	if (cur->bc_ag.refc.nr_ops == 0)
 		return true;
 	else if (overhead > cur->bc_tp->t_log_res)
 		return false;
 	return  cur->bc_tp->t_log_res - overhead >
-		cur->bc_ag.priv.refc.nr_ops * XFS_REFCOUNT_ITEM_OVERHEAD;
+		cur->bc_ag.refc.nr_ops * XFS_REFCOUNT_ITEM_OVERHEAD;
 }
 
 /*
@@ -968,7 +968,7 @@ xfs_refcount_adjust_extents(
 					error = -EFSCORRUPTED;
 					goto out_error;
 				}
-				cur->bc_ag.priv.refc.nr_ops++;
+				cur->bc_ag.refc.nr_ops++;
 			} else {
 				fsbno = XFS_AGB_TO_FSB(cur->bc_mp,
 						cur->bc_ag.agno,
@@ -1003,7 +1003,7 @@ xfs_refcount_adjust_extents(
 			error = xfs_refcount_update(cur, &ext);
 			if (error)
 				goto out_error;
-			cur->bc_ag.priv.refc.nr_ops++;
+			cur->bc_ag.refc.nr_ops++;
 		} else if (ext.rc_refcount == 1) {
 			error = xfs_refcount_delete(cur, &found_rec);
 			if (error)
@@ -1012,7 +1012,7 @@ xfs_refcount_adjust_extents(
 				error = -EFSCORRUPTED;
 				goto out_error;
 			}
-			cur->bc_ag.priv.refc.nr_ops++;
+			cur->bc_ag.refc.nr_ops++;
 			goto advloop;
 		} else {
 			fsbno = XFS_AGB_TO_FSB(cur->bc_mp,
@@ -1088,7 +1088,7 @@ xfs_refcount_adjust(
 	if (shape_changed)
 		shape_changes++;
 	if (shape_changes)
-		cur->bc_ag.priv.refc.shape_changes++;
+		cur->bc_ag.refc.shape_changes++;
 
 	/* Now that we've taken care of the ends, adjust the middle extents */
 	error = xfs_refcount_adjust_extents(cur, new_agbno, new_aglen,
@@ -1166,8 +1166,8 @@ xfs_refcount_finish_one(
 	 */
 	rcur = *pcur;
 	if (rcur != NULL && rcur->bc_ag.agno != agno) {
-		nr_ops = rcur->bc_ag.priv.refc.nr_ops;
-		shape_changes = rcur->bc_ag.priv.refc.shape_changes;
+		nr_ops = rcur->bc_ag.refc.nr_ops;
+		shape_changes = rcur->bc_ag.refc.shape_changes;
 		xfs_refcount_finish_one_cleanup(tp, rcur, 0);
 		rcur = NULL;
 		*pcur = NULL;
@@ -1183,8 +1183,8 @@ xfs_refcount_finish_one(
 			error = -ENOMEM;
 			goto out_cur;
 		}
-		rcur->bc_ag.priv.refc.nr_ops = nr_ops;
-		rcur->bc_ag.priv.refc.shape_changes = shape_changes;
+		rcur->bc_ag.refc.nr_ops = nr_ops;
+		rcur->bc_ag.refc.shape_changes = shape_changes;
 	}
 	*pcur = rcur;
 
diff --git a/fs/xfs/libxfs/xfs_refcount_btree.c b/fs/xfs/libxfs/xfs_refcount_btree.c
index bf1a4cb3c7ac..e07a2c45f8ec 100644
--- a/fs/xfs/libxfs/xfs_refcount_btree.c
+++ b/fs/xfs/libxfs/xfs_refcount_btree.c
@@ -340,8 +340,8 @@ xfs_refcountbt_init_cursor(
 	cur->bc_ag.agno = agno;
 	cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
 
-	cur->bc_ag.priv.refc.nr_ops = 0;
-	cur->bc_ag.priv.refc.shape_changes = 0;
+	cur->bc_ag.refc.nr_ops = 0;
+	cur->bc_ag.refc.shape_changes = 0;
 
 	return cur;
 }


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/7] xfs: introduce new private btree cursor names
  2020-03-12  3:44 ` [PATCH 1/7] xfs: introduce new private btree cursor names Darrick J. Wong
@ 2020-03-12 10:41   ` Brian Foster
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Foster @ 2020-03-12 10:41 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, david, Dave Chinner

On Wed, Mar 11, 2020 at 08:44:47PM -0700, Darrick J. Wong wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> Just the defines of the new names - the conversion will be in
> scripted commits after this.
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> [darrick: change "bc_bt" to "bc_ino"]
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/libxfs/xfs_btree.h |    2 ++
>  1 file changed, 2 insertions(+)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
> index 3eff7c321d43..4a1c98bdfaad 100644
> --- a/fs/xfs/libxfs/xfs_btree.h
> +++ b/fs/xfs/libxfs/xfs_btree.h
> @@ -224,6 +224,8 @@ typedef struct xfs_btree_cur
>  #define	XFS_BTCUR_BPRV_INVALID_OWNER	(1<<1)		/* for ext swap */
>  		} b;
>  	}		bc_private;	/* per-btree type data */
> +#define bc_ag	bc_private.a
> +#define bc_ino	bc_private.b
>  } xfs_btree_cur_t;
>  
>  /* cursor flags */
> 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/7] xfs: convert btree cursor ag-private member name
  2020-03-12  3:44 ` [PATCH 2/7] xfs: convert btree cursor ag-private member name Darrick J. Wong
@ 2020-03-12 10:42   ` Brian Foster
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Foster @ 2020-03-12 10:42 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, david, Dave Chinner

On Wed, Mar 11, 2020 at 08:44:54PM -0700, Darrick J. Wong wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> bc_private.a -> bc_ag conversion via script:
> 
> `sed -i 's/bc_private\.a/bc_ag/g' fs/xfs/*[ch] fs/xfs/*/*[ch]`
> 
> And then revert the change to the bc_ag #define in
> fs/xfs/libxfs/xfs_btree.h manually.
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Seems reasonable:

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/libxfs/xfs_alloc.c          |   16 +++--
>  fs/xfs/libxfs/xfs_alloc_btree.c    |   24 ++++----
>  fs/xfs/libxfs/xfs_btree.c          |   12 ++--
>  fs/xfs/libxfs/xfs_ialloc.c         |    2 -
>  fs/xfs/libxfs/xfs_ialloc_btree.c   |   20 +++----
>  fs/xfs/libxfs/xfs_refcount.c       |  110 ++++++++++++++++++------------------
>  fs/xfs/libxfs/xfs_refcount_btree.c |   28 +++++----
>  fs/xfs/libxfs/xfs_rmap.c           |  110 ++++++++++++++++++------------------
>  fs/xfs/libxfs/xfs_rmap_btree.c     |   28 +++++----
>  fs/xfs/scrub/agheader_repair.c     |    2 -
>  fs/xfs/scrub/alloc.c               |    2 -
>  fs/xfs/scrub/bmap.c                |    2 -
>  fs/xfs/scrub/ialloc.c              |    8 +--
>  fs/xfs/scrub/refcount.c            |    2 -
>  fs/xfs/scrub/rmap.c                |    2 -
>  fs/xfs/scrub/trace.c               |    2 -
>  fs/xfs/xfs_fsmap.c                 |    4 +
>  17 files changed, 187 insertions(+), 187 deletions(-)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index 5bc58b72a16f..10ed68dfef5d 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -151,7 +151,7 @@ xfs_alloc_lookup_eq(
>  	cur->bc_rec.a.ar_startblock = bno;
>  	cur->bc_rec.a.ar_blockcount = len;
>  	error = xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat);
> -	cur->bc_private.a.priv.abt.active = (*stat == 1);
> +	cur->bc_ag.priv.abt.active = (*stat == 1);
>  	return error;
>  }
>  
> @@ -171,7 +171,7 @@ xfs_alloc_lookup_ge(
>  	cur->bc_rec.a.ar_startblock = bno;
>  	cur->bc_rec.a.ar_blockcount = len;
>  	error = xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat);
> -	cur->bc_private.a.priv.abt.active = (*stat == 1);
> +	cur->bc_ag.priv.abt.active = (*stat == 1);
>  	return error;
>  }
>  
> @@ -190,7 +190,7 @@ xfs_alloc_lookup_le(
>  	cur->bc_rec.a.ar_startblock = bno;
>  	cur->bc_rec.a.ar_blockcount = len;
>  	error = xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat);
> -	cur->bc_private.a.priv.abt.active = (*stat == 1);
> +	cur->bc_ag.priv.abt.active = (*stat == 1);
>  	return error;
>  }
>  
> @@ -198,7 +198,7 @@ static inline bool
>  xfs_alloc_cur_active(
>  	struct xfs_btree_cur	*cur)
>  {
> -	return cur && cur->bc_private.a.priv.abt.active;
> +	return cur && cur->bc_ag.priv.abt.active;
>  }
>  
>  /*
> @@ -230,7 +230,7 @@ xfs_alloc_get_rec(
>  	int			*stat)	/* output: success/failure */
>  {
>  	struct xfs_mount	*mp = cur->bc_mp;
> -	xfs_agnumber_t		agno = cur->bc_private.a.agno;
> +	xfs_agnumber_t		agno = cur->bc_ag.agno;
>  	union xfs_btree_rec	*rec;
>  	int			error;
>  
> @@ -908,7 +908,7 @@ xfs_alloc_cur_check(
>  		deactivate = true;
>  out:
>  	if (deactivate)
> -		cur->bc_private.a.priv.abt.active = false;
> +		cur->bc_ag.priv.abt.active = false;
>  	trace_xfs_alloc_cur_check(args->mp, cur->bc_btnum, bno, len, diff,
>  				  *new);
>  	return 0;
> @@ -1352,7 +1352,7 @@ xfs_alloc_walk_iter(
>  		if (error)
>  			return error;
>  		if (i == 0)
> -			cur->bc_private.a.priv.abt.active = false;
> +			cur->bc_ag.priv.abt.active = false;
>  
>  		if (count > 0)
>  			count--;
> @@ -1467,7 +1467,7 @@ xfs_alloc_ag_vextent_locality(
>  		if (error)
>  			return error;
>  		if (i) {
> -			acur->cnt->bc_private.a.priv.abt.active = true;
> +			acur->cnt->bc_ag.priv.abt.active = true;
>  			fbcur = acur->cnt;
>  			fbinc = false;
>  		}
> diff --git a/fs/xfs/libxfs/xfs_alloc_btree.c b/fs/xfs/libxfs/xfs_alloc_btree.c
> index b1b3dc1b0b89..92d30c19519d 100644
> --- a/fs/xfs/libxfs/xfs_alloc_btree.c
> +++ b/fs/xfs/libxfs/xfs_alloc_btree.c
> @@ -25,7 +25,7 @@ xfs_allocbt_dup_cursor(
>  	struct xfs_btree_cur	*cur)
>  {
>  	return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp,
> -			cur->bc_private.a.agbp, cur->bc_private.a.agno,
> +			cur->bc_ag.agbp, cur->bc_ag.agno,
>  			cur->bc_btnum);
>  }
>  
> @@ -35,7 +35,7 @@ xfs_allocbt_set_root(
>  	union xfs_btree_ptr	*ptr,
>  	int			inc)
>  {
> -	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
> +	struct xfs_buf		*agbp = cur->bc_ag.agbp;
>  	struct xfs_agf		*agf = agbp->b_addr;
>  	xfs_agnumber_t		seqno = be32_to_cpu(agf->agf_seqno);
>  	int			btnum = cur->bc_btnum;
> @@ -62,7 +62,7 @@ xfs_allocbt_alloc_block(
>  	xfs_agblock_t		bno;
>  
>  	/* Allocate the new block from the freelist. If we can't, give up.  */
> -	error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_private.a.agbp,
> +	error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_ag.agbp,
>  				       &bno, 1);
>  	if (error)
>  		return error;
> @@ -72,7 +72,7 @@ xfs_allocbt_alloc_block(
>  		return 0;
>  	}
>  
> -	xfs_extent_busy_reuse(cur->bc_mp, cur->bc_private.a.agno, bno, 1, false);
> +	xfs_extent_busy_reuse(cur->bc_mp, cur->bc_ag.agno, bno, 1, false);
>  
>  	xfs_trans_agbtree_delta(cur->bc_tp, 1);
>  	new->s = cpu_to_be32(bno);
> @@ -86,7 +86,7 @@ xfs_allocbt_free_block(
>  	struct xfs_btree_cur	*cur,
>  	struct xfs_buf		*bp)
>  {
> -	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
> +	struct xfs_buf		*agbp = cur->bc_ag.agbp;
>  	struct xfs_agf		*agf = agbp->b_addr;
>  	xfs_agblock_t		bno;
>  	int			error;
> @@ -113,7 +113,7 @@ xfs_allocbt_update_lastrec(
>  	int			ptr,
>  	int			reason)
>  {
> -	struct xfs_agf		*agf = cur->bc_private.a.agbp->b_addr;
> +	struct xfs_agf		*agf = cur->bc_ag.agbp->b_addr;
>  	xfs_agnumber_t		seqno = be32_to_cpu(agf->agf_seqno);
>  	struct xfs_perag	*pag;
>  	__be32			len;
> @@ -162,7 +162,7 @@ xfs_allocbt_update_lastrec(
>  	pag = xfs_perag_get(cur->bc_mp, seqno);
>  	pag->pagf_longest = be32_to_cpu(len);
>  	xfs_perag_put(pag);
> -	xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, XFS_AGF_LONGEST);
> +	xfs_alloc_log_agf(cur->bc_tp, cur->bc_ag.agbp, XFS_AGF_LONGEST);
>  }
>  
>  STATIC int
> @@ -226,9 +226,9 @@ xfs_allocbt_init_ptr_from_cur(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_ptr	*ptr)
>  {
> -	struct xfs_agf		*agf = cur->bc_private.a.agbp->b_addr;
> +	struct xfs_agf		*agf = cur->bc_ag.agbp->b_addr;
>  
> -	ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno));
> +	ASSERT(cur->bc_ag.agno == be32_to_cpu(agf->agf_seqno));
>  
>  	ptr->s = agf->agf_roots[cur->bc_btnum];
>  }
> @@ -505,9 +505,9 @@ xfs_allocbt_init_cursor(
>  		cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]);
>  	}
>  
> -	cur->bc_private.a.agbp = agbp;
> -	cur->bc_private.a.agno = agno;
> -	cur->bc_private.a.priv.abt.active = false;
> +	cur->bc_ag.agbp = agbp;
> +	cur->bc_ag.agno = agno;
> +	cur->bc_ag.priv.abt.active = false;
>  
>  	if (xfs_sb_version_hascrc(&mp->m_sb))
>  		cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
> diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
> index 0599a3ee7d88..7681d48a2b13 100644
> --- a/fs/xfs/libxfs/xfs_btree.c
> +++ b/fs/xfs/libxfs/xfs_btree.c
> @@ -214,7 +214,7 @@ xfs_btree_check_sptr(
>  {
>  	if (level <= 0)
>  		return false;
> -	return xfs_verify_agbno(cur->bc_mp, cur->bc_private.a.agno, agbno);
> +	return xfs_verify_agbno(cur->bc_mp, cur->bc_ag.agno, agbno);
>  }
>  
>  /*
> @@ -243,7 +243,7 @@ xfs_btree_check_ptr(
>  			return 0;
>  		xfs_err(cur->bc_mp,
>  "AG %u: Corrupt btree %d pointer at level %d index %d.",
> -				cur->bc_private.a.agno, cur->bc_btnum,
> +				cur->bc_ag.agno, cur->bc_btnum,
>  				level, index);
>  	}
>  
> @@ -881,13 +881,13 @@ xfs_btree_readahead_sblock(
>  
>  
>  	if ((lr & XFS_BTCUR_LEFTRA) && left != NULLAGBLOCK) {
> -		xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno,
> +		xfs_btree_reada_bufs(cur->bc_mp, cur->bc_ag.agno,
>  				     left, 1, cur->bc_ops->buf_ops);
>  		rval++;
>  	}
>  
>  	if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLAGBLOCK) {
> -		xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno,
> +		xfs_btree_reada_bufs(cur->bc_mp, cur->bc_ag.agno,
>  				     right, 1, cur->bc_ops->buf_ops);
>  		rval++;
>  	}
> @@ -945,7 +945,7 @@ xfs_btree_ptr_to_daddr(
>  		*daddr = XFS_FSB_TO_DADDR(cur->bc_mp, fsbno);
>  	} else {
>  		agbno = be32_to_cpu(ptr->s);
> -		*daddr = XFS_AGB_TO_DADDR(cur->bc_mp, cur->bc_private.a.agno,
> +		*daddr = XFS_AGB_TO_DADDR(cur->bc_mp, cur->bc_ag.agno,
>  				agbno);
>  	}
>  
> @@ -1146,7 +1146,7 @@ xfs_btree_init_block_cur(
>  	if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
>  		owner = cur->bc_private.b.ip->i_ino;
>  	else
> -		owner = cur->bc_private.a.agno;
> +		owner = cur->bc_ag.agno;
>  
>  	xfs_btree_init_block_int(cur->bc_mp, XFS_BUF_TO_BLOCK(bp), bp->b_bn,
>  				 cur->bc_btnum, level, numrecs,
> diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
> index b4a404278935..21ac3fb52f4e 100644
> --- a/fs/xfs/libxfs/xfs_ialloc.c
> +++ b/fs/xfs/libxfs/xfs_ialloc.c
> @@ -105,7 +105,7 @@ xfs_inobt_get_rec(
>  	int				*stat)
>  {
>  	struct xfs_mount		*mp = cur->bc_mp;
> -	xfs_agnumber_t			agno = cur->bc_private.a.agno;
> +	xfs_agnumber_t			agno = cur->bc_ag.agno;
>  	union xfs_btree_rec		*rec;
>  	int				error;
>  	uint64_t			realfree;
> diff --git a/fs/xfs/libxfs/xfs_ialloc_btree.c b/fs/xfs/libxfs/xfs_ialloc_btree.c
> index 6903820f1c4b..e0e8570af023 100644
> --- a/fs/xfs/libxfs/xfs_ialloc_btree.c
> +++ b/fs/xfs/libxfs/xfs_ialloc_btree.c
> @@ -34,7 +34,7 @@ xfs_inobt_dup_cursor(
>  	struct xfs_btree_cur	*cur)
>  {
>  	return xfs_inobt_init_cursor(cur->bc_mp, cur->bc_tp,
> -			cur->bc_private.a.agbp, cur->bc_private.a.agno,
> +			cur->bc_ag.agbp, cur->bc_ag.agno,
>  			cur->bc_btnum);
>  }
>  
> @@ -44,7 +44,7 @@ xfs_inobt_set_root(
>  	union xfs_btree_ptr	*nptr,
>  	int			inc)	/* level change */
>  {
> -	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
> +	struct xfs_buf		*agbp = cur->bc_ag.agbp;
>  	struct xfs_agi		*agi = agbp->b_addr;
>  
>  	agi->agi_root = nptr->s;
> @@ -58,7 +58,7 @@ xfs_finobt_set_root(
>  	union xfs_btree_ptr	*nptr,
>  	int			inc)	/* level change */
>  {
> -	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
> +	struct xfs_buf		*agbp = cur->bc_ag.agbp;
>  	struct xfs_agi		*agi = agbp->b_addr;
>  
>  	agi->agi_free_root = nptr->s;
> @@ -83,7 +83,7 @@ __xfs_inobt_alloc_block(
>  	args.tp = cur->bc_tp;
>  	args.mp = cur->bc_mp;
>  	args.oinfo = XFS_RMAP_OINFO_INOBT;
> -	args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_private.a.agno, sbno);
> +	args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_ag.agno, sbno);
>  	args.minlen = 1;
>  	args.maxlen = 1;
>  	args.prod = 1;
> @@ -212,9 +212,9 @@ xfs_inobt_init_ptr_from_cur(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_ptr	*ptr)
>  {
> -	struct xfs_agi		*agi = cur->bc_private.a.agbp->b_addr;
> +	struct xfs_agi		*agi = cur->bc_ag.agbp->b_addr;
>  
> -	ASSERT(cur->bc_private.a.agno == be32_to_cpu(agi->agi_seqno));
> +	ASSERT(cur->bc_ag.agno == be32_to_cpu(agi->agi_seqno));
>  
>  	ptr->s = agi->agi_root;
>  }
> @@ -224,9 +224,9 @@ xfs_finobt_init_ptr_from_cur(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_ptr	*ptr)
>  {
> -	struct xfs_agi		*agi = cur->bc_private.a.agbp->b_addr;
> +	struct xfs_agi		*agi = cur->bc_ag.agbp->b_addr;
>  
> -	ASSERT(cur->bc_private.a.agno == be32_to_cpu(agi->agi_seqno));
> +	ASSERT(cur->bc_ag.agno == be32_to_cpu(agi->agi_seqno));
>  	ptr->s = agi->agi_free_root;
>  }
>  
> @@ -433,8 +433,8 @@ xfs_inobt_init_cursor(
>  	if (xfs_sb_version_hascrc(&mp->m_sb))
>  		cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
>  
> -	cur->bc_private.a.agbp = agbp;
> -	cur->bc_private.a.agno = agno;
> +	cur->bc_ag.agbp = agbp;
> +	cur->bc_ag.agno = agno;
>  
>  	return cur;
>  }
> diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
> index 6e1665f2cb67..ef3e706f1d94 100644
> --- a/fs/xfs/libxfs/xfs_refcount.c
> +++ b/fs/xfs/libxfs/xfs_refcount.c
> @@ -46,7 +46,7 @@ xfs_refcount_lookup_le(
>  	xfs_agblock_t		bno,
>  	int			*stat)
>  {
> -	trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_private.a.agno, bno,
> +	trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_ag.agno, bno,
>  			XFS_LOOKUP_LE);
>  	cur->bc_rec.rc.rc_startblock = bno;
>  	cur->bc_rec.rc.rc_blockcount = 0;
> @@ -63,7 +63,7 @@ xfs_refcount_lookup_ge(
>  	xfs_agblock_t		bno,
>  	int			*stat)
>  {
> -	trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_private.a.agno, bno,
> +	trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_ag.agno, bno,
>  			XFS_LOOKUP_GE);
>  	cur->bc_rec.rc.rc_startblock = bno;
>  	cur->bc_rec.rc.rc_blockcount = 0;
> @@ -80,7 +80,7 @@ xfs_refcount_lookup_eq(
>  	xfs_agblock_t		bno,
>  	int			*stat)
>  {
> -	trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_private.a.agno, bno,
> +	trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_ag.agno, bno,
>  			XFS_LOOKUP_LE);
>  	cur->bc_rec.rc.rc_startblock = bno;
>  	cur->bc_rec.rc.rc_blockcount = 0;
> @@ -108,7 +108,7 @@ xfs_refcount_get_rec(
>  	int				*stat)
>  {
>  	struct xfs_mount		*mp = cur->bc_mp;
> -	xfs_agnumber_t			agno = cur->bc_private.a.agno;
> +	xfs_agnumber_t			agno = cur->bc_ag.agno;
>  	union xfs_btree_rec		*rec;
>  	int				error;
>  	xfs_agblock_t			realstart;
> @@ -119,7 +119,7 @@ xfs_refcount_get_rec(
>  
>  	xfs_refcount_btrec_to_irec(rec, irec);
>  
> -	agno = cur->bc_private.a.agno;
> +	agno = cur->bc_ag.agno;
>  	if (irec->rc_blockcount == 0 || irec->rc_blockcount > MAXREFCEXTLEN)
>  		goto out_bad_rec;
>  
> @@ -144,7 +144,7 @@ xfs_refcount_get_rec(
>  	if (irec->rc_refcount == 0 || irec->rc_refcount > MAXREFCOUNT)
>  		goto out_bad_rec;
>  
> -	trace_xfs_refcount_get(cur->bc_mp, cur->bc_private.a.agno, irec);
> +	trace_xfs_refcount_get(cur->bc_mp, cur->bc_ag.agno, irec);
>  	return 0;
>  
>  out_bad_rec:
> @@ -169,14 +169,14 @@ xfs_refcount_update(
>  	union xfs_btree_rec	rec;
>  	int			error;
>  
> -	trace_xfs_refcount_update(cur->bc_mp, cur->bc_private.a.agno, irec);
> +	trace_xfs_refcount_update(cur->bc_mp, cur->bc_ag.agno, irec);
>  	rec.refc.rc_startblock = cpu_to_be32(irec->rc_startblock);
>  	rec.refc.rc_blockcount = cpu_to_be32(irec->rc_blockcount);
>  	rec.refc.rc_refcount = cpu_to_be32(irec->rc_refcount);
>  	error = xfs_btree_update(cur, &rec);
>  	if (error)
>  		trace_xfs_refcount_update_error(cur->bc_mp,
> -				cur->bc_private.a.agno, error, _RET_IP_);
> +				cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -193,7 +193,7 @@ xfs_refcount_insert(
>  {
>  	int				error;
>  
> -	trace_xfs_refcount_insert(cur->bc_mp, cur->bc_private.a.agno, irec);
> +	trace_xfs_refcount_insert(cur->bc_mp, cur->bc_ag.agno, irec);
>  	cur->bc_rec.rc.rc_startblock = irec->rc_startblock;
>  	cur->bc_rec.rc.rc_blockcount = irec->rc_blockcount;
>  	cur->bc_rec.rc.rc_refcount = irec->rc_refcount;
> @@ -208,7 +208,7 @@ xfs_refcount_insert(
>  out_error:
>  	if (error)
>  		trace_xfs_refcount_insert_error(cur->bc_mp,
> -				cur->bc_private.a.agno, error, _RET_IP_);
> +				cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -234,7 +234,7 @@ xfs_refcount_delete(
>  		error = -EFSCORRUPTED;
>  		goto out_error;
>  	}
> -	trace_xfs_refcount_delete(cur->bc_mp, cur->bc_private.a.agno, &irec);
> +	trace_xfs_refcount_delete(cur->bc_mp, cur->bc_ag.agno, &irec);
>  	error = xfs_btree_delete(cur, i);
>  	if (XFS_IS_CORRUPT(cur->bc_mp, *i != 1)) {
>  		error = -EFSCORRUPTED;
> @@ -246,7 +246,7 @@ xfs_refcount_delete(
>  out_error:
>  	if (error)
>  		trace_xfs_refcount_delete_error(cur->bc_mp,
> -				cur->bc_private.a.agno, error, _RET_IP_);
> +				cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -366,7 +366,7 @@ xfs_refcount_split_extent(
>  		return 0;
>  
>  	*shape_changed = true;
> -	trace_xfs_refcount_split_extent(cur->bc_mp, cur->bc_private.a.agno,
> +	trace_xfs_refcount_split_extent(cur->bc_mp, cur->bc_ag.agno,
>  			&rcext, agbno);
>  
>  	/* Establish the right extent. */
> @@ -391,7 +391,7 @@ xfs_refcount_split_extent(
>  
>  out_error:
>  	trace_xfs_refcount_split_extent_error(cur->bc_mp,
> -			cur->bc_private.a.agno, error, _RET_IP_);
> +			cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -411,7 +411,7 @@ xfs_refcount_merge_center_extents(
>  	int				found_rec;
>  
>  	trace_xfs_refcount_merge_center_extents(cur->bc_mp,
> -			cur->bc_private.a.agno, left, center, right);
> +			cur->bc_ag.agno, left, center, right);
>  
>  	/*
>  	 * Make sure the center and right extents are not in the btree.
> @@ -468,7 +468,7 @@ xfs_refcount_merge_center_extents(
>  
>  out_error:
>  	trace_xfs_refcount_merge_center_extents_error(cur->bc_mp,
> -			cur->bc_private.a.agno, error, _RET_IP_);
> +			cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -487,7 +487,7 @@ xfs_refcount_merge_left_extent(
>  	int				found_rec;
>  
>  	trace_xfs_refcount_merge_left_extent(cur->bc_mp,
> -			cur->bc_private.a.agno, left, cleft);
> +			cur->bc_ag.agno, left, cleft);
>  
>  	/* If the extent at agbno (cleft) wasn't synthesized, remove it. */
>  	if (cleft->rc_refcount > 1) {
> @@ -530,7 +530,7 @@ xfs_refcount_merge_left_extent(
>  
>  out_error:
>  	trace_xfs_refcount_merge_left_extent_error(cur->bc_mp,
> -			cur->bc_private.a.agno, error, _RET_IP_);
> +			cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -548,7 +548,7 @@ xfs_refcount_merge_right_extent(
>  	int				found_rec;
>  
>  	trace_xfs_refcount_merge_right_extent(cur->bc_mp,
> -			cur->bc_private.a.agno, cright, right);
> +			cur->bc_ag.agno, cright, right);
>  
>  	/*
>  	 * If the extent ending at agbno+aglen (cright) wasn't synthesized,
> @@ -594,7 +594,7 @@ xfs_refcount_merge_right_extent(
>  
>  out_error:
>  	trace_xfs_refcount_merge_right_extent_error(cur->bc_mp,
> -			cur->bc_private.a.agno, error, _RET_IP_);
> +			cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -679,13 +679,13 @@ xfs_refcount_find_left_extents(
>  		cleft->rc_blockcount = aglen;
>  		cleft->rc_refcount = 1;
>  	}
> -	trace_xfs_refcount_find_left_extent(cur->bc_mp, cur->bc_private.a.agno,
> +	trace_xfs_refcount_find_left_extent(cur->bc_mp, cur->bc_ag.agno,
>  			left, cleft, agbno);
>  	return error;
>  
>  out_error:
>  	trace_xfs_refcount_find_left_extent_error(cur->bc_mp,
> -			cur->bc_private.a.agno, error, _RET_IP_);
> +			cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -768,13 +768,13 @@ xfs_refcount_find_right_extents(
>  		cright->rc_blockcount = aglen;
>  		cright->rc_refcount = 1;
>  	}
> -	trace_xfs_refcount_find_right_extent(cur->bc_mp, cur->bc_private.a.agno,
> +	trace_xfs_refcount_find_right_extent(cur->bc_mp, cur->bc_ag.agno,
>  			cright, right, agbno + aglen);
>  	return error;
>  
>  out_error:
>  	trace_xfs_refcount_find_right_extent_error(cur->bc_mp,
> -			cur->bc_private.a.agno, error, _RET_IP_);
> +			cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -883,7 +883,7 @@ xfs_refcount_still_have_space(
>  {
>  	unsigned long			overhead;
>  
> -	overhead = cur->bc_private.a.priv.refc.shape_changes *
> +	overhead = cur->bc_ag.priv.refc.shape_changes *
>  			xfs_allocfree_log_count(cur->bc_mp, 1);
>  	overhead *= cur->bc_mp->m_sb.sb_blocksize;
>  
> @@ -891,17 +891,17 @@ xfs_refcount_still_have_space(
>  	 * Only allow 2 refcount extent updates per transaction if the
>  	 * refcount continue update "error" has been injected.
>  	 */
> -	if (cur->bc_private.a.priv.refc.nr_ops > 2 &&
> +	if (cur->bc_ag.priv.refc.nr_ops > 2 &&
>  	    XFS_TEST_ERROR(false, cur->bc_mp,
>  			XFS_ERRTAG_REFCOUNT_CONTINUE_UPDATE))
>  		return false;
>  
> -	if (cur->bc_private.a.priv.refc.nr_ops == 0)
> +	if (cur->bc_ag.priv.refc.nr_ops == 0)
>  		return true;
>  	else if (overhead > cur->bc_tp->t_log_res)
>  		return false;
>  	return  cur->bc_tp->t_log_res - overhead >
> -		cur->bc_private.a.priv.refc.nr_ops * XFS_REFCOUNT_ITEM_OVERHEAD;
> +		cur->bc_ag.priv.refc.nr_ops * XFS_REFCOUNT_ITEM_OVERHEAD;
>  }
>  
>  /*
> @@ -952,7 +952,7 @@ xfs_refcount_adjust_extents(
>  					ext.rc_startblock - *agbno);
>  			tmp.rc_refcount = 1 + adj;
>  			trace_xfs_refcount_modify_extent(cur->bc_mp,
> -					cur->bc_private.a.agno, &tmp);
> +					cur->bc_ag.agno, &tmp);
>  
>  			/*
>  			 * Either cover the hole (increment) or
> @@ -968,10 +968,10 @@ xfs_refcount_adjust_extents(
>  					error = -EFSCORRUPTED;
>  					goto out_error;
>  				}
> -				cur->bc_private.a.priv.refc.nr_ops++;
> +				cur->bc_ag.priv.refc.nr_ops++;
>  			} else {
>  				fsbno = XFS_AGB_TO_FSB(cur->bc_mp,
> -						cur->bc_private.a.agno,
> +						cur->bc_ag.agno,
>  						tmp.rc_startblock);
>  				xfs_bmap_add_free(cur->bc_tp, fsbno,
>  						  tmp.rc_blockcount, oinfo);
> @@ -998,12 +998,12 @@ xfs_refcount_adjust_extents(
>  			goto skip;
>  		ext.rc_refcount += adj;
>  		trace_xfs_refcount_modify_extent(cur->bc_mp,
> -				cur->bc_private.a.agno, &ext);
> +				cur->bc_ag.agno, &ext);
>  		if (ext.rc_refcount > 1) {
>  			error = xfs_refcount_update(cur, &ext);
>  			if (error)
>  				goto out_error;
> -			cur->bc_private.a.priv.refc.nr_ops++;
> +			cur->bc_ag.priv.refc.nr_ops++;
>  		} else if (ext.rc_refcount == 1) {
>  			error = xfs_refcount_delete(cur, &found_rec);
>  			if (error)
> @@ -1012,11 +1012,11 @@ xfs_refcount_adjust_extents(
>  				error = -EFSCORRUPTED;
>  				goto out_error;
>  			}
> -			cur->bc_private.a.priv.refc.nr_ops++;
> +			cur->bc_ag.priv.refc.nr_ops++;
>  			goto advloop;
>  		} else {
>  			fsbno = XFS_AGB_TO_FSB(cur->bc_mp,
> -					cur->bc_private.a.agno,
> +					cur->bc_ag.agno,
>  					ext.rc_startblock);
>  			xfs_bmap_add_free(cur->bc_tp, fsbno, ext.rc_blockcount,
>  					  oinfo);
> @@ -1035,7 +1035,7 @@ xfs_refcount_adjust_extents(
>  	return error;
>  out_error:
>  	trace_xfs_refcount_modify_extent_error(cur->bc_mp,
> -			cur->bc_private.a.agno, error, _RET_IP_);
> +			cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -1057,10 +1057,10 @@ xfs_refcount_adjust(
>  	*new_agbno = agbno;
>  	*new_aglen = aglen;
>  	if (adj == XFS_REFCOUNT_ADJUST_INCREASE)
> -		trace_xfs_refcount_increase(cur->bc_mp, cur->bc_private.a.agno,
> +		trace_xfs_refcount_increase(cur->bc_mp, cur->bc_ag.agno,
>  				agbno, aglen);
>  	else
> -		trace_xfs_refcount_decrease(cur->bc_mp, cur->bc_private.a.agno,
> +		trace_xfs_refcount_decrease(cur->bc_mp, cur->bc_ag.agno,
>  				agbno, aglen);
>  
>  	/*
> @@ -1088,7 +1088,7 @@ xfs_refcount_adjust(
>  	if (shape_changed)
>  		shape_changes++;
>  	if (shape_changes)
> -		cur->bc_private.a.priv.refc.shape_changes++;
> +		cur->bc_ag.priv.refc.shape_changes++;
>  
>  	/* Now that we've taken care of the ends, adjust the middle extents */
>  	error = xfs_refcount_adjust_extents(cur, new_agbno, new_aglen,
> @@ -1099,7 +1099,7 @@ xfs_refcount_adjust(
>  	return 0;
>  
>  out_error:
> -	trace_xfs_refcount_adjust_error(cur->bc_mp, cur->bc_private.a.agno,
> +	trace_xfs_refcount_adjust_error(cur->bc_mp, cur->bc_ag.agno,
>  			error, _RET_IP_);
>  	return error;
>  }
> @@ -1115,7 +1115,7 @@ xfs_refcount_finish_one_cleanup(
>  
>  	if (rcur == NULL)
>  		return;
> -	agbp = rcur->bc_private.a.agbp;
> +	agbp = rcur->bc_ag.agbp;
>  	xfs_btree_del_cursor(rcur, error);
>  	if (error)
>  		xfs_trans_brelse(tp, agbp);
> @@ -1165,9 +1165,9 @@ xfs_refcount_finish_one(
>  	 * the startblock, get one now.
>  	 */
>  	rcur = *pcur;
> -	if (rcur != NULL && rcur->bc_private.a.agno != agno) {
> -		nr_ops = rcur->bc_private.a.priv.refc.nr_ops;
> -		shape_changes = rcur->bc_private.a.priv.refc.shape_changes;
> +	if (rcur != NULL && rcur->bc_ag.agno != agno) {
> +		nr_ops = rcur->bc_ag.priv.refc.nr_ops;
> +		shape_changes = rcur->bc_ag.priv.refc.shape_changes;
>  		xfs_refcount_finish_one_cleanup(tp, rcur, 0);
>  		rcur = NULL;
>  		*pcur = NULL;
> @@ -1183,8 +1183,8 @@ xfs_refcount_finish_one(
>  			error = -ENOMEM;
>  			goto out_cur;
>  		}
> -		rcur->bc_private.a.priv.refc.nr_ops = nr_ops;
> -		rcur->bc_private.a.priv.refc.shape_changes = shape_changes;
> +		rcur->bc_ag.priv.refc.nr_ops = nr_ops;
> +		rcur->bc_ag.priv.refc.shape_changes = shape_changes;
>  	}
>  	*pcur = rcur;
>  
> @@ -1303,7 +1303,7 @@ xfs_refcount_find_shared(
>  	int				have;
>  	int				error;
>  
> -	trace_xfs_refcount_find_shared(cur->bc_mp, cur->bc_private.a.agno,
> +	trace_xfs_refcount_find_shared(cur->bc_mp, cur->bc_ag.agno,
>  			agbno, aglen);
>  
>  	/* By default, skip the whole range */
> @@ -1383,12 +1383,12 @@ xfs_refcount_find_shared(
>  
>  done:
>  	trace_xfs_refcount_find_shared_result(cur->bc_mp,
> -			cur->bc_private.a.agno, *fbno, *flen);
> +			cur->bc_ag.agno, *fbno, *flen);
>  
>  out_error:
>  	if (error)
>  		trace_xfs_refcount_find_shared_error(cur->bc_mp,
> -				cur->bc_private.a.agno, error, _RET_IP_);
> +				cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -1485,7 +1485,7 @@ xfs_refcount_adjust_cow_extents(
>  		tmp.rc_blockcount = aglen;
>  		tmp.rc_refcount = 1;
>  		trace_xfs_refcount_modify_extent(cur->bc_mp,
> -				cur->bc_private.a.agno, &tmp);
> +				cur->bc_ag.agno, &tmp);
>  
>  		error = xfs_refcount_insert(cur, &tmp,
>  				&found_tmp);
> @@ -1513,7 +1513,7 @@ xfs_refcount_adjust_cow_extents(
>  
>  		ext.rc_refcount = 0;
>  		trace_xfs_refcount_modify_extent(cur->bc_mp,
> -				cur->bc_private.a.agno, &ext);
> +				cur->bc_ag.agno, &ext);
>  		error = xfs_refcount_delete(cur, &found_rec);
>  		if (error)
>  			goto out_error;
> @@ -1529,7 +1529,7 @@ xfs_refcount_adjust_cow_extents(
>  	return error;
>  out_error:
>  	trace_xfs_refcount_modify_extent_error(cur->bc_mp,
> -			cur->bc_private.a.agno, error, _RET_IP_);
> +			cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -1575,7 +1575,7 @@ xfs_refcount_adjust_cow(
>  	return 0;
>  
>  out_error:
> -	trace_xfs_refcount_adjust_cow_error(cur->bc_mp, cur->bc_private.a.agno,
> +	trace_xfs_refcount_adjust_cow_error(cur->bc_mp, cur->bc_ag.agno,
>  			error, _RET_IP_);
>  	return error;
>  }
> @@ -1589,7 +1589,7 @@ __xfs_refcount_cow_alloc(
>  	xfs_agblock_t		agbno,
>  	xfs_extlen_t		aglen)
>  {
> -	trace_xfs_refcount_cow_increase(rcur->bc_mp, rcur->bc_private.a.agno,
> +	trace_xfs_refcount_cow_increase(rcur->bc_mp, rcur->bc_ag.agno,
>  			agbno, aglen);
>  
>  	/* Add refcount btree reservation */
> @@ -1606,7 +1606,7 @@ __xfs_refcount_cow_free(
>  	xfs_agblock_t		agbno,
>  	xfs_extlen_t		aglen)
>  {
> -	trace_xfs_refcount_cow_decrease(rcur->bc_mp, rcur->bc_private.a.agno,
> +	trace_xfs_refcount_cow_decrease(rcur->bc_mp, rcur->bc_ag.agno,
>  			agbno, aglen);
>  
>  	/* Remove refcount btree reservation */
> diff --git a/fs/xfs/libxfs/xfs_refcount_btree.c b/fs/xfs/libxfs/xfs_refcount_btree.c
> index a76997740e45..bf1a4cb3c7ac 100644
> --- a/fs/xfs/libxfs/xfs_refcount_btree.c
> +++ b/fs/xfs/libxfs/xfs_refcount_btree.c
> @@ -25,7 +25,7 @@ xfs_refcountbt_dup_cursor(
>  	struct xfs_btree_cur	*cur)
>  {
>  	return xfs_refcountbt_init_cursor(cur->bc_mp, cur->bc_tp,
> -			cur->bc_private.a.agbp, cur->bc_private.a.agno);
> +			cur->bc_ag.agbp, cur->bc_ag.agno);
>  }
>  
>  STATIC void
> @@ -34,7 +34,7 @@ xfs_refcountbt_set_root(
>  	union xfs_btree_ptr	*ptr,
>  	int			inc)
>  {
> -	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
> +	struct xfs_buf		*agbp = cur->bc_ag.agbp;
>  	struct xfs_agf		*agf = agbp->b_addr;
>  	xfs_agnumber_t		seqno = be32_to_cpu(agf->agf_seqno);
>  	struct xfs_perag	*pag = xfs_perag_get(cur->bc_mp, seqno);
> @@ -57,7 +57,7 @@ xfs_refcountbt_alloc_block(
>  	union xfs_btree_ptr	*new,
>  	int			*stat)
>  {
> -	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
> +	struct xfs_buf		*agbp = cur->bc_ag.agbp;
>  	struct xfs_agf		*agf = agbp->b_addr;
>  	struct xfs_alloc_arg	args;		/* block allocation args */
>  	int			error;		/* error return value */
> @@ -66,7 +66,7 @@ xfs_refcountbt_alloc_block(
>  	args.tp = cur->bc_tp;
>  	args.mp = cur->bc_mp;
>  	args.type = XFS_ALLOCTYPE_NEAR_BNO;
> -	args.fsbno = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno,
> +	args.fsbno = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_ag.agno,
>  			xfs_refc_block(args.mp));
>  	args.oinfo = XFS_RMAP_OINFO_REFC;
>  	args.minlen = args.maxlen = args.prod = 1;
> @@ -75,13 +75,13 @@ xfs_refcountbt_alloc_block(
>  	error = xfs_alloc_vextent(&args);
>  	if (error)
>  		goto out_error;
> -	trace_xfs_refcountbt_alloc_block(cur->bc_mp, cur->bc_private.a.agno,
> +	trace_xfs_refcountbt_alloc_block(cur->bc_mp, cur->bc_ag.agno,
>  			args.agbno, 1);
>  	if (args.fsbno == NULLFSBLOCK) {
>  		*stat = 0;
>  		return 0;
>  	}
> -	ASSERT(args.agno == cur->bc_private.a.agno);
> +	ASSERT(args.agno == cur->bc_ag.agno);
>  	ASSERT(args.len == 1);
>  
>  	new->s = cpu_to_be32(args.agbno);
> @@ -101,12 +101,12 @@ xfs_refcountbt_free_block(
>  	struct xfs_buf		*bp)
>  {
>  	struct xfs_mount	*mp = cur->bc_mp;
> -	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
> +	struct xfs_buf		*agbp = cur->bc_ag.agbp;
>  	struct xfs_agf		*agf = agbp->b_addr;
>  	xfs_fsblock_t		fsbno = XFS_DADDR_TO_FSB(mp, XFS_BUF_ADDR(bp));
>  	int			error;
>  
> -	trace_xfs_refcountbt_free_block(cur->bc_mp, cur->bc_private.a.agno,
> +	trace_xfs_refcountbt_free_block(cur->bc_mp, cur->bc_ag.agno,
>  			XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno), 1);
>  	be32_add_cpu(&agf->agf_refcount_blocks, -1);
>  	xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_REFCOUNT_BLOCKS);
> @@ -169,9 +169,9 @@ xfs_refcountbt_init_ptr_from_cur(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_ptr	*ptr)
>  {
> -	struct xfs_agf		*agf = cur->bc_private.a.agbp->b_addr;
> +	struct xfs_agf		*agf = cur->bc_ag.agbp->b_addr;
>  
> -	ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno));
> +	ASSERT(cur->bc_ag.agno == be32_to_cpu(agf->agf_seqno));
>  
>  	ptr->s = agf->agf_refcount_root;
>  }
> @@ -336,12 +336,12 @@ xfs_refcountbt_init_cursor(
>  
>  	cur->bc_nlevels = be32_to_cpu(agf->agf_refcount_level);
>  
> -	cur->bc_private.a.agbp = agbp;
> -	cur->bc_private.a.agno = agno;
> +	cur->bc_ag.agbp = agbp;
> +	cur->bc_ag.agno = agno;
>  	cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
>  
> -	cur->bc_private.a.priv.refc.nr_ops = 0;
> -	cur->bc_private.a.priv.refc.shape_changes = 0;
> +	cur->bc_ag.priv.refc.nr_ops = 0;
> +	cur->bc_ag.priv.refc.shape_changes = 0;
>  
>  	return cur;
>  }
> diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c
> index dae1a2bf28eb..27c39268c31f 100644
> --- a/fs/xfs/libxfs/xfs_rmap.c
> +++ b/fs/xfs/libxfs/xfs_rmap.c
> @@ -79,7 +79,7 @@ xfs_rmap_update(
>  	union xfs_btree_rec	rec;
>  	int			error;
>  
> -	trace_xfs_rmap_update(cur->bc_mp, cur->bc_private.a.agno,
> +	trace_xfs_rmap_update(cur->bc_mp, cur->bc_ag.agno,
>  			irec->rm_startblock, irec->rm_blockcount,
>  			irec->rm_owner, irec->rm_offset, irec->rm_flags);
>  
> @@ -91,7 +91,7 @@ xfs_rmap_update(
>  	error = xfs_btree_update(cur, &rec);
>  	if (error)
>  		trace_xfs_rmap_update_error(cur->bc_mp,
> -				cur->bc_private.a.agno, error, _RET_IP_);
> +				cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -107,7 +107,7 @@ xfs_rmap_insert(
>  	int			i;
>  	int			error;
>  
> -	trace_xfs_rmap_insert(rcur->bc_mp, rcur->bc_private.a.agno, agbno,
> +	trace_xfs_rmap_insert(rcur->bc_mp, rcur->bc_ag.agno, agbno,
>  			len, owner, offset, flags);
>  
>  	error = xfs_rmap_lookup_eq(rcur, agbno, len, owner, offset, flags, &i);
> @@ -133,7 +133,7 @@ xfs_rmap_insert(
>  done:
>  	if (error)
>  		trace_xfs_rmap_insert_error(rcur->bc_mp,
> -				rcur->bc_private.a.agno, error, _RET_IP_);
> +				rcur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -149,7 +149,7 @@ xfs_rmap_delete(
>  	int			i;
>  	int			error;
>  
> -	trace_xfs_rmap_delete(rcur->bc_mp, rcur->bc_private.a.agno, agbno,
> +	trace_xfs_rmap_delete(rcur->bc_mp, rcur->bc_ag.agno, agbno,
>  			len, owner, offset, flags);
>  
>  	error = xfs_rmap_lookup_eq(rcur, agbno, len, owner, offset, flags, &i);
> @@ -170,7 +170,7 @@ xfs_rmap_delete(
>  done:
>  	if (error)
>  		trace_xfs_rmap_delete_error(rcur->bc_mp,
> -				rcur->bc_private.a.agno, error, _RET_IP_);
> +				rcur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -197,7 +197,7 @@ xfs_rmap_get_rec(
>  	int			*stat)
>  {
>  	struct xfs_mount	*mp = cur->bc_mp;
> -	xfs_agnumber_t		agno = cur->bc_private.a.agno;
> +	xfs_agnumber_t		agno = cur->bc_ag.agno;
>  	union xfs_btree_rec	*rec;
>  	int			error;
>  
> @@ -260,7 +260,7 @@ xfs_rmap_find_left_neighbor_helper(
>  	struct xfs_find_left_neighbor_info	*info = priv;
>  
>  	trace_xfs_rmap_find_left_neighbor_candidate(cur->bc_mp,
> -			cur->bc_private.a.agno, rec->rm_startblock,
> +			cur->bc_ag.agno, rec->rm_startblock,
>  			rec->rm_blockcount, rec->rm_owner, rec->rm_offset,
>  			rec->rm_flags);
>  
> @@ -312,7 +312,7 @@ xfs_rmap_find_left_neighbor(
>  	info.stat = stat;
>  
>  	trace_xfs_rmap_find_left_neighbor_query(cur->bc_mp,
> -			cur->bc_private.a.agno, bno, 0, owner, offset, flags);
> +			cur->bc_ag.agno, bno, 0, owner, offset, flags);
>  
>  	error = xfs_rmap_query_range(cur, &info.high, &info.high,
>  			xfs_rmap_find_left_neighbor_helper, &info);
> @@ -320,7 +320,7 @@ xfs_rmap_find_left_neighbor(
>  		error = 0;
>  	if (*stat)
>  		trace_xfs_rmap_find_left_neighbor_result(cur->bc_mp,
> -				cur->bc_private.a.agno, irec->rm_startblock,
> +				cur->bc_ag.agno, irec->rm_startblock,
>  				irec->rm_blockcount, irec->rm_owner,
>  				irec->rm_offset, irec->rm_flags);
>  	return error;
> @@ -336,7 +336,7 @@ xfs_rmap_lookup_le_range_helper(
>  	struct xfs_find_left_neighbor_info	*info = priv;
>  
>  	trace_xfs_rmap_lookup_le_range_candidate(cur->bc_mp,
> -			cur->bc_private.a.agno, rec->rm_startblock,
> +			cur->bc_ag.agno, rec->rm_startblock,
>  			rec->rm_blockcount, rec->rm_owner, rec->rm_offset,
>  			rec->rm_flags);
>  
> @@ -385,14 +385,14 @@ xfs_rmap_lookup_le_range(
>  	info.stat = stat;
>  
>  	trace_xfs_rmap_lookup_le_range(cur->bc_mp,
> -			cur->bc_private.a.agno, bno, 0, owner, offset, flags);
> +			cur->bc_ag.agno, bno, 0, owner, offset, flags);
>  	error = xfs_rmap_query_range(cur, &info.high, &info.high,
>  			xfs_rmap_lookup_le_range_helper, &info);
>  	if (error == -ECANCELED)
>  		error = 0;
>  	if (*stat)
>  		trace_xfs_rmap_lookup_le_range_result(cur->bc_mp,
> -				cur->bc_private.a.agno, irec->rm_startblock,
> +				cur->bc_ag.agno, irec->rm_startblock,
>  				irec->rm_blockcount, irec->rm_owner,
>  				irec->rm_offset, irec->rm_flags);
>  	return error;
> @@ -498,7 +498,7 @@ xfs_rmap_unmap(
>  			(flags & XFS_RMAP_BMBT_BLOCK);
>  	if (unwritten)
>  		flags |= XFS_RMAP_UNWRITTEN;
> -	trace_xfs_rmap_unmap(mp, cur->bc_private.a.agno, bno, len,
> +	trace_xfs_rmap_unmap(mp, cur->bc_ag.agno, bno, len,
>  			unwritten, oinfo);
>  
>  	/*
> @@ -522,7 +522,7 @@ xfs_rmap_unmap(
>  		goto out_error;
>  	}
>  	trace_xfs_rmap_lookup_le_range_result(cur->bc_mp,
> -			cur->bc_private.a.agno, ltrec.rm_startblock,
> +			cur->bc_ag.agno, ltrec.rm_startblock,
>  			ltrec.rm_blockcount, ltrec.rm_owner,
>  			ltrec.rm_offset, ltrec.rm_flags);
>  	ltoff = ltrec.rm_offset;
> @@ -588,7 +588,7 @@ xfs_rmap_unmap(
>  
>  	if (ltrec.rm_startblock == bno && ltrec.rm_blockcount == len) {
>  		/* exact match, simply remove the record from rmap tree */
> -		trace_xfs_rmap_delete(mp, cur->bc_private.a.agno,
> +		trace_xfs_rmap_delete(mp, cur->bc_ag.agno,
>  				ltrec.rm_startblock, ltrec.rm_blockcount,
>  				ltrec.rm_owner, ltrec.rm_offset,
>  				ltrec.rm_flags);
> @@ -666,7 +666,7 @@ xfs_rmap_unmap(
>  		else
>  			cur->bc_rec.r.rm_offset = offset + len;
>  		cur->bc_rec.r.rm_flags = flags;
> -		trace_xfs_rmap_insert(mp, cur->bc_private.a.agno,
> +		trace_xfs_rmap_insert(mp, cur->bc_ag.agno,
>  				cur->bc_rec.r.rm_startblock,
>  				cur->bc_rec.r.rm_blockcount,
>  				cur->bc_rec.r.rm_owner,
> @@ -678,11 +678,11 @@ xfs_rmap_unmap(
>  	}
>  
>  out_done:
> -	trace_xfs_rmap_unmap_done(mp, cur->bc_private.a.agno, bno, len,
> +	trace_xfs_rmap_unmap_done(mp, cur->bc_ag.agno, bno, len,
>  			unwritten, oinfo);
>  out_error:
>  	if (error)
> -		trace_xfs_rmap_unmap_error(mp, cur->bc_private.a.agno,
> +		trace_xfs_rmap_unmap_error(mp, cur->bc_ag.agno,
>  				error, _RET_IP_);
>  	return error;
>  }
> @@ -773,7 +773,7 @@ xfs_rmap_map(
>  			(flags & XFS_RMAP_BMBT_BLOCK);
>  	if (unwritten)
>  		flags |= XFS_RMAP_UNWRITTEN;
> -	trace_xfs_rmap_map(mp, cur->bc_private.a.agno, bno, len,
> +	trace_xfs_rmap_map(mp, cur->bc_ag.agno, bno, len,
>  			unwritten, oinfo);
>  	ASSERT(!xfs_rmap_should_skip_owner_update(oinfo));
>  
> @@ -795,7 +795,7 @@ xfs_rmap_map(
>  			goto out_error;
>  		}
>  		trace_xfs_rmap_lookup_le_range_result(cur->bc_mp,
> -				cur->bc_private.a.agno, ltrec.rm_startblock,
> +				cur->bc_ag.agno, ltrec.rm_startblock,
>  				ltrec.rm_blockcount, ltrec.rm_owner,
>  				ltrec.rm_offset, ltrec.rm_flags);
>  
> @@ -831,7 +831,7 @@ xfs_rmap_map(
>  			goto out_error;
>  		}
>  		trace_xfs_rmap_find_right_neighbor_result(cur->bc_mp,
> -			cur->bc_private.a.agno, gtrec.rm_startblock,
> +			cur->bc_ag.agno, gtrec.rm_startblock,
>  			gtrec.rm_blockcount, gtrec.rm_owner,
>  			gtrec.rm_offset, gtrec.rm_flags);
>  		if (!xfs_rmap_is_mergeable(&gtrec, owner, flags))
> @@ -870,7 +870,7 @@ xfs_rmap_map(
>  			 * result: |rrrrrrrrrrrrrrrrrrrrrrrrrrrrr|
>  			 */
>  			ltrec.rm_blockcount += gtrec.rm_blockcount;
> -			trace_xfs_rmap_delete(mp, cur->bc_private.a.agno,
> +			trace_xfs_rmap_delete(mp, cur->bc_ag.agno,
>  					gtrec.rm_startblock,
>  					gtrec.rm_blockcount,
>  					gtrec.rm_owner,
> @@ -921,7 +921,7 @@ xfs_rmap_map(
>  		cur->bc_rec.r.rm_owner = owner;
>  		cur->bc_rec.r.rm_offset = offset;
>  		cur->bc_rec.r.rm_flags = flags;
> -		trace_xfs_rmap_insert(mp, cur->bc_private.a.agno, bno, len,
> +		trace_xfs_rmap_insert(mp, cur->bc_ag.agno, bno, len,
>  			owner, offset, flags);
>  		error = xfs_btree_insert(cur, &i);
>  		if (error)
> @@ -932,11 +932,11 @@ xfs_rmap_map(
>  		}
>  	}
>  
> -	trace_xfs_rmap_map_done(mp, cur->bc_private.a.agno, bno, len,
> +	trace_xfs_rmap_map_done(mp, cur->bc_ag.agno, bno, len,
>  			unwritten, oinfo);
>  out_error:
>  	if (error)
> -		trace_xfs_rmap_map_error(mp, cur->bc_private.a.agno,
> +		trace_xfs_rmap_map_error(mp, cur->bc_ag.agno,
>  				error, _RET_IP_);
>  	return error;
>  }
> @@ -1010,7 +1010,7 @@ xfs_rmap_convert(
>  			(flags & (XFS_RMAP_ATTR_FORK | XFS_RMAP_BMBT_BLOCK))));
>  	oldext = unwritten ? XFS_RMAP_UNWRITTEN : 0;
>  	new_endoff = offset + len;
> -	trace_xfs_rmap_convert(mp, cur->bc_private.a.agno, bno, len,
> +	trace_xfs_rmap_convert(mp, cur->bc_ag.agno, bno, len,
>  			unwritten, oinfo);
>  
>  	/*
> @@ -1034,7 +1034,7 @@ xfs_rmap_convert(
>  		goto done;
>  	}
>  	trace_xfs_rmap_lookup_le_range_result(cur->bc_mp,
> -			cur->bc_private.a.agno, PREV.rm_startblock,
> +			cur->bc_ag.agno, PREV.rm_startblock,
>  			PREV.rm_blockcount, PREV.rm_owner,
>  			PREV.rm_offset, PREV.rm_flags);
>  
> @@ -1076,7 +1076,7 @@ xfs_rmap_convert(
>  			goto done;
>  		}
>  		trace_xfs_rmap_find_left_neighbor_result(cur->bc_mp,
> -				cur->bc_private.a.agno, LEFT.rm_startblock,
> +				cur->bc_ag.agno, LEFT.rm_startblock,
>  				LEFT.rm_blockcount, LEFT.rm_owner,
>  				LEFT.rm_offset, LEFT.rm_flags);
>  		if (LEFT.rm_startblock + LEFT.rm_blockcount == bno &&
> @@ -1114,7 +1114,7 @@ xfs_rmap_convert(
>  			goto done;
>  		}
>  		trace_xfs_rmap_find_right_neighbor_result(cur->bc_mp,
> -				cur->bc_private.a.agno, RIGHT.rm_startblock,
> +				cur->bc_ag.agno, RIGHT.rm_startblock,
>  				RIGHT.rm_blockcount, RIGHT.rm_owner,
>  				RIGHT.rm_offset, RIGHT.rm_flags);
>  		if (bno + len == RIGHT.rm_startblock &&
> @@ -1132,7 +1132,7 @@ xfs_rmap_convert(
>  	     RIGHT.rm_blockcount > XFS_RMAP_LEN_MAX)
>  		state &= ~RMAP_RIGHT_CONTIG;
>  
> -	trace_xfs_rmap_convert_state(mp, cur->bc_private.a.agno, state,
> +	trace_xfs_rmap_convert_state(mp, cur->bc_ag.agno, state,
>  			_RET_IP_);
>  
>  	/* reset the cursor back to PREV */
> @@ -1162,7 +1162,7 @@ xfs_rmap_convert(
>  			error = -EFSCORRUPTED;
>  			goto done;
>  		}
> -		trace_xfs_rmap_delete(mp, cur->bc_private.a.agno,
> +		trace_xfs_rmap_delete(mp, cur->bc_ag.agno,
>  				RIGHT.rm_startblock, RIGHT.rm_blockcount,
>  				RIGHT.rm_owner, RIGHT.rm_offset,
>  				RIGHT.rm_flags);
> @@ -1180,7 +1180,7 @@ xfs_rmap_convert(
>  			error = -EFSCORRUPTED;
>  			goto done;
>  		}
> -		trace_xfs_rmap_delete(mp, cur->bc_private.a.agno,
> +		trace_xfs_rmap_delete(mp, cur->bc_ag.agno,
>  				PREV.rm_startblock, PREV.rm_blockcount,
>  				PREV.rm_owner, PREV.rm_offset,
>  				PREV.rm_flags);
> @@ -1210,7 +1210,7 @@ xfs_rmap_convert(
>  		 * Setting all of a previous oldext extent to newext.
>  		 * The left neighbor is contiguous, the right is not.
>  		 */
> -		trace_xfs_rmap_delete(mp, cur->bc_private.a.agno,
> +		trace_xfs_rmap_delete(mp, cur->bc_ag.agno,
>  				PREV.rm_startblock, PREV.rm_blockcount,
>  				PREV.rm_owner, PREV.rm_offset,
>  				PREV.rm_flags);
> @@ -1247,7 +1247,7 @@ xfs_rmap_convert(
>  			error = -EFSCORRUPTED;
>  			goto done;
>  		}
> -		trace_xfs_rmap_delete(mp, cur->bc_private.a.agno,
> +		trace_xfs_rmap_delete(mp, cur->bc_ag.agno,
>  				RIGHT.rm_startblock, RIGHT.rm_blockcount,
>  				RIGHT.rm_owner, RIGHT.rm_offset,
>  				RIGHT.rm_flags);
> @@ -1326,7 +1326,7 @@ xfs_rmap_convert(
>  		NEW.rm_blockcount = len;
>  		NEW.rm_flags = newext;
>  		cur->bc_rec.r = NEW;
> -		trace_xfs_rmap_insert(mp, cur->bc_private.a.agno, bno,
> +		trace_xfs_rmap_insert(mp, cur->bc_ag.agno, bno,
>  				len, owner, offset, newext);
>  		error = xfs_btree_insert(cur, &i);
>  		if (error)
> @@ -1383,7 +1383,7 @@ xfs_rmap_convert(
>  		NEW.rm_blockcount = len;
>  		NEW.rm_flags = newext;
>  		cur->bc_rec.r = NEW;
> -		trace_xfs_rmap_insert(mp, cur->bc_private.a.agno, bno,
> +		trace_xfs_rmap_insert(mp, cur->bc_ag.agno, bno,
>  				len, owner, offset, newext);
>  		error = xfs_btree_insert(cur, &i);
>  		if (error)
> @@ -1414,7 +1414,7 @@ xfs_rmap_convert(
>  		NEW = PREV;
>  		NEW.rm_blockcount = offset - PREV.rm_offset;
>  		cur->bc_rec.r = NEW;
> -		trace_xfs_rmap_insert(mp, cur->bc_private.a.agno,
> +		trace_xfs_rmap_insert(mp, cur->bc_ag.agno,
>  				NEW.rm_startblock, NEW.rm_blockcount,
>  				NEW.rm_owner, NEW.rm_offset,
>  				NEW.rm_flags);
> @@ -1441,7 +1441,7 @@ xfs_rmap_convert(
>  		/* new middle extent - newext */
>  		cur->bc_rec.r.rm_flags &= ~XFS_RMAP_UNWRITTEN;
>  		cur->bc_rec.r.rm_flags |= newext;
> -		trace_xfs_rmap_insert(mp, cur->bc_private.a.agno, bno, len,
> +		trace_xfs_rmap_insert(mp, cur->bc_ag.agno, bno, len,
>  				owner, offset, newext);
>  		error = xfs_btree_insert(cur, &i);
>  		if (error)
> @@ -1465,12 +1465,12 @@ xfs_rmap_convert(
>  		ASSERT(0);
>  	}
>  
> -	trace_xfs_rmap_convert_done(mp, cur->bc_private.a.agno, bno, len,
> +	trace_xfs_rmap_convert_done(mp, cur->bc_ag.agno, bno, len,
>  			unwritten, oinfo);
>  done:
>  	if (error)
>  		trace_xfs_rmap_convert_error(cur->bc_mp,
> -				cur->bc_private.a.agno, error, _RET_IP_);
> +				cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -1506,7 +1506,7 @@ xfs_rmap_convert_shared(
>  			(flags & (XFS_RMAP_ATTR_FORK | XFS_RMAP_BMBT_BLOCK))));
>  	oldext = unwritten ? XFS_RMAP_UNWRITTEN : 0;
>  	new_endoff = offset + len;
> -	trace_xfs_rmap_convert(mp, cur->bc_private.a.agno, bno, len,
> +	trace_xfs_rmap_convert(mp, cur->bc_ag.agno, bno, len,
>  			unwritten, oinfo);
>  
>  	/*
> @@ -1573,7 +1573,7 @@ xfs_rmap_convert_shared(
>  			goto done;
>  		}
>  		trace_xfs_rmap_find_right_neighbor_result(cur->bc_mp,
> -				cur->bc_private.a.agno, RIGHT.rm_startblock,
> +				cur->bc_ag.agno, RIGHT.rm_startblock,
>  				RIGHT.rm_blockcount, RIGHT.rm_owner,
>  				RIGHT.rm_offset, RIGHT.rm_flags);
>  		if (xfs_rmap_is_mergeable(&RIGHT, owner, newext))
> @@ -1589,7 +1589,7 @@ xfs_rmap_convert_shared(
>  	     RIGHT.rm_blockcount > XFS_RMAP_LEN_MAX)
>  		state &= ~RMAP_RIGHT_CONTIG;
>  
> -	trace_xfs_rmap_convert_state(mp, cur->bc_private.a.agno, state,
> +	trace_xfs_rmap_convert_state(mp, cur->bc_ag.agno, state,
>  			_RET_IP_);
>  	/*
>  	 * Switch out based on the FILLING and CONTIG state bits.
> @@ -1880,12 +1880,12 @@ xfs_rmap_convert_shared(
>  		ASSERT(0);
>  	}
>  
> -	trace_xfs_rmap_convert_done(mp, cur->bc_private.a.agno, bno, len,
> +	trace_xfs_rmap_convert_done(mp, cur->bc_ag.agno, bno, len,
>  			unwritten, oinfo);
>  done:
>  	if (error)
>  		trace_xfs_rmap_convert_error(cur->bc_mp,
> -				cur->bc_private.a.agno, error, _RET_IP_);
> +				cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -1923,7 +1923,7 @@ xfs_rmap_unmap_shared(
>  	xfs_owner_info_unpack(oinfo, &owner, &offset, &flags);
>  	if (unwritten)
>  		flags |= XFS_RMAP_UNWRITTEN;
> -	trace_xfs_rmap_unmap(mp, cur->bc_private.a.agno, bno, len,
> +	trace_xfs_rmap_unmap(mp, cur->bc_ag.agno, bno, len,
>  			unwritten, oinfo);
>  
>  	/*
> @@ -2072,12 +2072,12 @@ xfs_rmap_unmap_shared(
>  			goto out_error;
>  	}
>  
> -	trace_xfs_rmap_unmap_done(mp, cur->bc_private.a.agno, bno, len,
> +	trace_xfs_rmap_unmap_done(mp, cur->bc_ag.agno, bno, len,
>  			unwritten, oinfo);
>  out_error:
>  	if (error)
>  		trace_xfs_rmap_unmap_error(cur->bc_mp,
> -				cur->bc_private.a.agno, error, _RET_IP_);
> +				cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -2112,7 +2112,7 @@ xfs_rmap_map_shared(
>  	xfs_owner_info_unpack(oinfo, &owner, &offset, &flags);
>  	if (unwritten)
>  		flags |= XFS_RMAP_UNWRITTEN;
> -	trace_xfs_rmap_map(mp, cur->bc_private.a.agno, bno, len,
> +	trace_xfs_rmap_map(mp, cur->bc_ag.agno, bno, len,
>  			unwritten, oinfo);
>  
>  	/* Is there a left record that abuts our range? */
> @@ -2138,7 +2138,7 @@ xfs_rmap_map_shared(
>  			goto out_error;
>  		}
>  		trace_xfs_rmap_find_right_neighbor_result(cur->bc_mp,
> -			cur->bc_private.a.agno, gtrec.rm_startblock,
> +			cur->bc_ag.agno, gtrec.rm_startblock,
>  			gtrec.rm_blockcount, gtrec.rm_owner,
>  			gtrec.rm_offset, gtrec.rm_flags);
>  
> @@ -2231,12 +2231,12 @@ xfs_rmap_map_shared(
>  			goto out_error;
>  	}
>  
> -	trace_xfs_rmap_map_done(mp, cur->bc_private.a.agno, bno, len,
> +	trace_xfs_rmap_map_done(mp, cur->bc_ag.agno, bno, len,
>  			unwritten, oinfo);
>  out_error:
>  	if (error)
>  		trace_xfs_rmap_map_error(cur->bc_mp,
> -				cur->bc_private.a.agno, error, _RET_IP_);
> +				cur->bc_ag.agno, error, _RET_IP_);
>  	return error;
>  }
>  
> @@ -2336,7 +2336,7 @@ xfs_rmap_finish_one_cleanup(
>  
>  	if (rcur == NULL)
>  		return;
> -	agbp = rcur->bc_private.a.agbp;
> +	agbp = rcur->bc_ag.agbp;
>  	xfs_btree_del_cursor(rcur, error);
>  	if (error)
>  		xfs_trans_brelse(tp, agbp);
> @@ -2386,7 +2386,7 @@ xfs_rmap_finish_one(
>  	 * the startblock, get one now.
>  	 */
>  	rcur = *pcur;
> -	if (rcur != NULL && rcur->bc_private.a.agno != agno) {
> +	if (rcur != NULL && rcur->bc_ag.agno != agno) {
>  		xfs_rmap_finish_one_cleanup(tp, rcur, 0);
>  		rcur = NULL;
>  		*pcur = NULL;
> diff --git a/fs/xfs/libxfs/xfs_rmap_btree.c b/fs/xfs/libxfs/xfs_rmap_btree.c
> index 725cb892f157..af7e4966416f 100644
> --- a/fs/xfs/libxfs/xfs_rmap_btree.c
> +++ b/fs/xfs/libxfs/xfs_rmap_btree.c
> @@ -51,7 +51,7 @@ xfs_rmapbt_dup_cursor(
>  	struct xfs_btree_cur	*cur)
>  {
>  	return xfs_rmapbt_init_cursor(cur->bc_mp, cur->bc_tp,
> -			cur->bc_private.a.agbp, cur->bc_private.a.agno);
> +			cur->bc_ag.agbp, cur->bc_ag.agno);
>  }
>  
>  STATIC void
> @@ -60,7 +60,7 @@ xfs_rmapbt_set_root(
>  	union xfs_btree_ptr	*ptr,
>  	int			inc)
>  {
> -	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
> +	struct xfs_buf		*agbp = cur->bc_ag.agbp;
>  	struct xfs_agf		*agf = agbp->b_addr;
>  	xfs_agnumber_t		seqno = be32_to_cpu(agf->agf_seqno);
>  	int			btnum = cur->bc_btnum;
> @@ -83,25 +83,25 @@ xfs_rmapbt_alloc_block(
>  	union xfs_btree_ptr	*new,
>  	int			*stat)
>  {
> -	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
> +	struct xfs_buf		*agbp = cur->bc_ag.agbp;
>  	struct xfs_agf		*agf = agbp->b_addr;
>  	int			error;
>  	xfs_agblock_t		bno;
>  
>  	/* Allocate the new block from the freelist. If we can't, give up.  */
> -	error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_private.a.agbp,
> +	error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_ag.agbp,
>  				       &bno, 1);
>  	if (error)
>  		return error;
>  
> -	trace_xfs_rmapbt_alloc_block(cur->bc_mp, cur->bc_private.a.agno,
> +	trace_xfs_rmapbt_alloc_block(cur->bc_mp, cur->bc_ag.agno,
>  			bno, 1);
>  	if (bno == NULLAGBLOCK) {
>  		*stat = 0;
>  		return 0;
>  	}
>  
> -	xfs_extent_busy_reuse(cur->bc_mp, cur->bc_private.a.agno, bno, 1,
> +	xfs_extent_busy_reuse(cur->bc_mp, cur->bc_ag.agno, bno, 1,
>  			false);
>  
>  	xfs_trans_agbtree_delta(cur->bc_tp, 1);
> @@ -109,7 +109,7 @@ xfs_rmapbt_alloc_block(
>  	be32_add_cpu(&agf->agf_rmap_blocks, 1);
>  	xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_RMAP_BLOCKS);
>  
> -	xfs_ag_resv_rmapbt_alloc(cur->bc_mp, cur->bc_private.a.agno);
> +	xfs_ag_resv_rmapbt_alloc(cur->bc_mp, cur->bc_ag.agno);
>  
>  	*stat = 1;
>  	return 0;
> @@ -120,13 +120,13 @@ xfs_rmapbt_free_block(
>  	struct xfs_btree_cur	*cur,
>  	struct xfs_buf		*bp)
>  {
> -	struct xfs_buf		*agbp = cur->bc_private.a.agbp;
> +	struct xfs_buf		*agbp = cur->bc_ag.agbp;
>  	struct xfs_agf		*agf = agbp->b_addr;
>  	xfs_agblock_t		bno;
>  	int			error;
>  
>  	bno = xfs_daddr_to_agbno(cur->bc_mp, XFS_BUF_ADDR(bp));
> -	trace_xfs_rmapbt_free_block(cur->bc_mp, cur->bc_private.a.agno,
> +	trace_xfs_rmapbt_free_block(cur->bc_mp, cur->bc_ag.agno,
>  			bno, 1);
>  	be32_add_cpu(&agf->agf_rmap_blocks, -1);
>  	xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_RMAP_BLOCKS);
> @@ -138,7 +138,7 @@ xfs_rmapbt_free_block(
>  			      XFS_EXTENT_BUSY_SKIP_DISCARD);
>  	xfs_trans_agbtree_delta(cur->bc_tp, -1);
>  
> -	xfs_ag_resv_rmapbt_free(cur->bc_mp, cur->bc_private.a.agno);
> +	xfs_ag_resv_rmapbt_free(cur->bc_mp, cur->bc_ag.agno);
>  
>  	return 0;
>  }
> @@ -215,9 +215,9 @@ xfs_rmapbt_init_ptr_from_cur(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_ptr	*ptr)
>  {
> -	struct xfs_agf		*agf = cur->bc_private.a.agbp->b_addr;
> +	struct xfs_agf		*agf = cur->bc_ag.agbp->b_addr;
>  
> -	ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno));
> +	ASSERT(cur->bc_ag.agno == be32_to_cpu(agf->agf_seqno));
>  
>  	ptr->s = agf->agf_roots[cur->bc_btnum];
>  }
> @@ -472,8 +472,8 @@ xfs_rmapbt_init_cursor(
>  	cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]);
>  	cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_rmap_2);
>  
> -	cur->bc_private.a.agbp = agbp;
> -	cur->bc_private.a.agno = agno;
> +	cur->bc_ag.agbp = agbp;
> +	cur->bc_ag.agno = agno;
>  
>  	return cur;
>  }
> diff --git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c
> index 9b3954d7f7d9..73e6efd76877 100644
> --- a/fs/xfs/scrub/agheader_repair.c
> +++ b/fs/xfs/scrub/agheader_repair.c
> @@ -453,7 +453,7 @@ xrep_agfl_walk_rmap(
>  
>  	/* Record all the OWN_AG blocks. */
>  	if (rec->rm_owner == XFS_RMAP_OWN_AG) {
> -		fsb = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno,
> +		fsb = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_ag.agno,
>  				rec->rm_startblock);
>  		error = xfs_bitmap_set(ra->freesp, fsb, rec->rm_blockcount);
>  		if (error)
> diff --git a/fs/xfs/scrub/alloc.c b/fs/xfs/scrub/alloc.c
> index 5533e48e605d..73d924e47565 100644
> --- a/fs/xfs/scrub/alloc.c
> +++ b/fs/xfs/scrub/alloc.c
> @@ -94,7 +94,7 @@ xchk_allocbt_rec(
>  	union xfs_btree_rec	*rec)
>  {
>  	struct xfs_mount	*mp = bs->cur->bc_mp;
> -	xfs_agnumber_t		agno = bs->cur->bc_private.a.agno;
> +	xfs_agnumber_t		agno = bs->cur->bc_ag.agno;
>  	xfs_agblock_t		bno;
>  	xfs_extlen_t		len;
>  
> diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
> index fa6ea6407992..1c866594ec34 100644
> --- a/fs/xfs/scrub/bmap.c
> +++ b/fs/xfs/scrub/bmap.c
> @@ -501,7 +501,7 @@ xchk_bmap_check_rmap(
>  			xchk_fblock_set_corrupt(sc, sbcri->whichfork,
>  					rec->rm_offset);
>  		if (irec.br_startblock != XFS_AGB_TO_FSB(sc->mp,
> -				cur->bc_private.a.agno, rec->rm_startblock))
> +				cur->bc_ag.agno, rec->rm_startblock))
>  			xchk_fblock_set_corrupt(sc, sbcri->whichfork,
>  					rec->rm_offset);
>  		if (irec.br_blockcount > rec->rm_blockcount)
> diff --git a/fs/xfs/scrub/ialloc.c b/fs/xfs/scrub/ialloc.c
> index 681758704fda..64c217eb06a7 100644
> --- a/fs/xfs/scrub/ialloc.c
> +++ b/fs/xfs/scrub/ialloc.c
> @@ -104,7 +104,7 @@ xchk_iallocbt_chunk(
>  	xfs_extlen_t			len)
>  {
>  	struct xfs_mount		*mp = bs->cur->bc_mp;
> -	xfs_agnumber_t			agno = bs->cur->bc_private.a.agno;
> +	xfs_agnumber_t			agno = bs->cur->bc_ag.agno;
>  	xfs_agblock_t			bno;
>  
>  	bno = XFS_AGINO_TO_AGBNO(mp, agino);
> @@ -164,7 +164,7 @@ xchk_iallocbt_check_cluster_ifree(
>  	 * the record, compute which fs inode we're talking about.
>  	 */
>  	agino = irec->ir_startino + irec_ino;
> -	fsino = XFS_AGINO_TO_INO(mp, bs->cur->bc_private.a.agno, agino);
> +	fsino = XFS_AGINO_TO_INO(mp, bs->cur->bc_ag.agno, agino);
>  	irec_free = (irec->ir_free & XFS_INOBT_MASK(irec_ino));
>  
>  	if (be16_to_cpu(dip->di_magic) != XFS_DINODE_MAGIC ||
> @@ -215,7 +215,7 @@ xchk_iallocbt_check_cluster(
>  	struct xfs_dinode		*dip;
>  	struct xfs_buf			*cluster_bp;
>  	unsigned int			nr_inodes;
> -	xfs_agnumber_t			agno = bs->cur->bc_private.a.agno;
> +	xfs_agnumber_t			agno = bs->cur->bc_ag.agno;
>  	xfs_agblock_t			agbno;
>  	unsigned int			cluster_index;
>  	uint16_t			cluster_mask = 0;
> @@ -426,7 +426,7 @@ xchk_iallocbt_rec(
>  	struct xchk_iallocbt		*iabt = bs->private;
>  	struct xfs_inobt_rec_incore	irec;
>  	uint64_t			holes;
> -	xfs_agnumber_t			agno = bs->cur->bc_private.a.agno;
> +	xfs_agnumber_t			agno = bs->cur->bc_ag.agno;
>  	xfs_agino_t			agino;
>  	xfs_extlen_t			len;
>  	int				holecount;
> diff --git a/fs/xfs/scrub/refcount.c b/fs/xfs/scrub/refcount.c
> index 0cab11a5d390..beaeb6fa3119 100644
> --- a/fs/xfs/scrub/refcount.c
> +++ b/fs/xfs/scrub/refcount.c
> @@ -336,7 +336,7 @@ xchk_refcountbt_rec(
>  {
>  	struct xfs_mount	*mp = bs->cur->bc_mp;
>  	xfs_agblock_t		*cow_blocks = bs->private;
> -	xfs_agnumber_t		agno = bs->cur->bc_private.a.agno;
> +	xfs_agnumber_t		agno = bs->cur->bc_ag.agno;
>  	xfs_agblock_t		bno;
>  	xfs_extlen_t		len;
>  	xfs_nlink_t		refcount;
> diff --git a/fs/xfs/scrub/rmap.c b/fs/xfs/scrub/rmap.c
> index 8d4cefd761c1..f4fcb4719f41 100644
> --- a/fs/xfs/scrub/rmap.c
> +++ b/fs/xfs/scrub/rmap.c
> @@ -92,7 +92,7 @@ xchk_rmapbt_rec(
>  {
>  	struct xfs_mount	*mp = bs->cur->bc_mp;
>  	struct xfs_rmap_irec	irec;
> -	xfs_agnumber_t		agno = bs->cur->bc_private.a.agno;
> +	xfs_agnumber_t		agno = bs->cur->bc_ag.agno;
>  	bool			non_inode;
>  	bool			is_unwritten;
>  	bool			is_bmbt;
> diff --git a/fs/xfs/scrub/trace.c b/fs/xfs/scrub/trace.c
> index 9eaab2eb5ed3..731111e1448c 100644
> --- a/fs/xfs/scrub/trace.c
> +++ b/fs/xfs/scrub/trace.c
> @@ -26,7 +26,7 @@ xchk_btree_cur_fsbno(
>  		 cur->bc_flags & XFS_BTREE_LONG_PTRS)
>  		return XFS_INO_TO_FSB(cur->bc_mp, cur->bc_private.b.ip->i_ino);
>  	else if (!(cur->bc_flags & XFS_BTREE_LONG_PTRS))
> -		return XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno, 0);
> +		return XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_ag.agno, 0);
>  	return NULLFSBLOCK;
>  }
>  
> diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c
> index 918456ca29e1..910ad46e2bba 100644
> --- a/fs/xfs/xfs_fsmap.c
> +++ b/fs/xfs/xfs_fsmap.c
> @@ -344,7 +344,7 @@ xfs_getfsmap_datadev_helper(
>  	xfs_fsblock_t			fsb;
>  	xfs_daddr_t			rec_daddr;
>  
> -	fsb = XFS_AGB_TO_FSB(mp, cur->bc_private.a.agno, rec->rm_startblock);
> +	fsb = XFS_AGB_TO_FSB(mp, cur->bc_ag.agno, rec->rm_startblock);
>  	rec_daddr = XFS_FSB_TO_DADDR(mp, fsb);
>  
>  	return xfs_getfsmap_helper(cur->bc_tp, info, rec, rec_daddr);
> @@ -362,7 +362,7 @@ xfs_getfsmap_datadev_bnobt_helper(
>  	struct xfs_rmap_irec		irec;
>  	xfs_daddr_t			rec_daddr;
>  
> -	rec_daddr = XFS_AGB_TO_DADDR(mp, cur->bc_private.a.agno,
> +	rec_daddr = XFS_AGB_TO_DADDR(mp, cur->bc_ag.agno,
>  			rec->ar_startblock);
>  
>  	irec.rm_startblock = rec->ar_startblock;
> 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/7] xfs: convert btree cursor inode-private member names
  2020-03-12  3:45 ` [PATCH 3/7] xfs: convert btree cursor inode-private member names Darrick J. Wong
@ 2020-03-12 10:42   ` Brian Foster
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Foster @ 2020-03-12 10:42 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, david, Dave Chinner

On Wed, Mar 11, 2020 at 08:45:00PM -0700, Darrick J. Wong wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> bc_private.b -> bc_ino conversion via script:
> 
> $ sed -i 's/bc_private\.b/bc_ino/g' fs/xfs/*[ch] fs/xfs/*/*[ch]
> 
> And then revert the change to the bc_ino #define in
> fs/xfs/libxfs/xfs_btree.h manually.
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> [darrick: tweak the subject line slightly]
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/libxfs/xfs_bmap.c       |   44 ++++++++++++++++++-----------------
>  fs/xfs/libxfs/xfs_bmap_btree.c |   50 ++++++++++++++++++++--------------------
>  fs/xfs/libxfs/xfs_btree.c      |   50 ++++++++++++++++++++--------------------
>  fs/xfs/scrub/bmap.c            |    2 +-
>  fs/xfs/scrub/trace.c           |    2 +-
>  fs/xfs/scrub/trace.h           |    4 ++-
>  6 files changed, 76 insertions(+), 76 deletions(-)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 43ae2ab21084..fc8f6d65576c 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -690,7 +690,7 @@ xfs_bmap_extents_to_btree(
>  	 * Need a cursor.  Can't allocate until bb_level is filled in.
>  	 */
>  	cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
> -	cur->bc_private.b.flags = wasdel ? XFS_BTCUR_BPRV_WASDEL : 0;
> +	cur->bc_ino.flags = wasdel ? XFS_BTCUR_BPRV_WASDEL : 0;
>  	/*
>  	 * Convert to a btree with two levels, one record in root.
>  	 */
> @@ -727,7 +727,7 @@ xfs_bmap_extents_to_btree(
>  	ASSERT(tp->t_firstblock == NULLFSBLOCK ||
>  	       args.agno >= XFS_FSB_TO_AGNO(mp, tp->t_firstblock));
>  	tp->t_firstblock = args.fsbno;
> -	cur->bc_private.b.allocated++;
> +	cur->bc_ino.allocated++;
>  	ip->i_d.di_nblocks++;
>  	xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, 1L);
>  	error = xfs_trans_get_buf(tp, mp->m_ddev_targp,
> @@ -953,7 +953,7 @@ xfs_bmap_add_attrfork_btree(
>  			xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
>  			return -ENOSPC;
>  		}
> -		cur->bc_private.b.allocated = 0;
> +		cur->bc_ino.allocated = 0;
>  		xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
>  	}
>  	return 0;
> @@ -980,7 +980,7 @@ xfs_bmap_add_attrfork_extents(
>  	error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0, flags,
>  					  XFS_DATA_FORK);
>  	if (cur) {
> -		cur->bc_private.b.allocated = 0;
> +		cur->bc_ino.allocated = 0;
>  		xfs_btree_del_cursor(cur, error);
>  	}
>  	return error;
> @@ -1178,13 +1178,13 @@ xfs_iread_bmbt_block(
>  {
>  	struct xfs_iread_state	*ir = priv;
>  	struct xfs_mount	*mp = cur->bc_mp;
> -	struct xfs_inode	*ip = cur->bc_private.b.ip;
> +	struct xfs_inode	*ip = cur->bc_ino.ip;
>  	struct xfs_btree_block	*block;
>  	struct xfs_buf		*bp;
>  	struct xfs_bmbt_rec	*frp;
>  	xfs_extnum_t		num_recs;
>  	xfs_extnum_t		j;
> -	int			whichfork = cur->bc_private.b.whichfork;
> +	int			whichfork = cur->bc_ino.whichfork;
>  
>  	block = xfs_btree_get_block(cur, level, &bp);
>  
> @@ -1528,7 +1528,7 @@ xfs_bmap_add_extent_delay_real(
>  
>  	ASSERT(!isnullstartblock(new->br_startblock));
>  	ASSERT(!bma->cur ||
> -	       (bma->cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL));
> +	       (bma->cur->bc_ino.flags & XFS_BTCUR_BPRV_WASDEL));
>  
>  	XFS_STATS_INC(mp, xs_add_exlist);
>  
> @@ -1818,7 +1818,7 @@ xfs_bmap_add_extent_delay_real(
>  		temp = PREV.br_blockcount - new->br_blockcount;
>  		da_new = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(bma->ip, temp),
>  			startblockval(PREV.br_startblock) -
> -			(bma->cur ? bma->cur->bc_private.b.allocated : 0));
> +			(bma->cur ? bma->cur->bc_ino.allocated : 0));
>  
>  		PREV.br_startoff = new_endoff;
>  		PREV.br_blockcount = temp;
> @@ -1904,7 +1904,7 @@ xfs_bmap_add_extent_delay_real(
>  		temp = PREV.br_blockcount - new->br_blockcount;
>  		da_new = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(bma->ip, temp),
>  			startblockval(PREV.br_startblock) -
> -			(bma->cur ? bma->cur->bc_private.b.allocated : 0));
> +			(bma->cur ? bma->cur->bc_ino.allocated : 0));
>  
>  		PREV.br_startblock = nullstartblock(da_new);
>  		PREV.br_blockcount = temp;
> @@ -2025,8 +2025,8 @@ xfs_bmap_add_extent_delay_real(
>  		xfs_mod_delalloc(mp, (int64_t)da_new - da_old);
>  
>  	if (bma->cur) {
> -		da_new += bma->cur->bc_private.b.allocated;
> -		bma->cur->bc_private.b.allocated = 0;
> +		da_new += bma->cur->bc_ino.allocated;
> +		bma->cur->bc_ino.allocated = 0;
>  	}
>  
>  	/* adjust for changes in reserved delayed indirect blocks */
> @@ -2573,7 +2573,7 @@ xfs_bmap_add_extent_unwritten_real(
>  
>  	/* clear out the allocated field, done with it now in any case. */
>  	if (cur) {
> -		cur->bc_private.b.allocated = 0;
> +		cur->bc_ino.allocated = 0;
>  		*curp = cur;
>  	}
>  
> @@ -2752,7 +2752,7 @@ xfs_bmap_add_extent_hole_real(
>  	struct xfs_bmbt_irec	old;
>  
>  	ASSERT(!isnullstartblock(new->br_startblock));
> -	ASSERT(!cur || !(cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL));
> +	ASSERT(!cur || !(cur->bc_ino.flags & XFS_BTCUR_BPRV_WASDEL));
>  
>  	XFS_STATS_INC(mp, xs_add_exlist);
>  
> @@ -2955,7 +2955,7 @@ xfs_bmap_add_extent_hole_real(
>  
>  	/* clear out the allocated field, done with it now in any case. */
>  	if (cur)
> -		cur->bc_private.b.allocated = 0;
> +		cur->bc_ino.allocated = 0;
>  
>  	xfs_bmap_check_leaf_extents(cur, ip, whichfork);
>  done:
> @@ -4187,7 +4187,7 @@ xfs_bmapi_allocate(
>  	bma->nallocs++;
>  
>  	if (bma->cur)
> -		bma->cur->bc_private.b.flags =
> +		bma->cur->bc_ino.flags =
>  			bma->wasdel ? XFS_BTCUR_BPRV_WASDEL : 0;
>  
>  	bma->got.br_startoff = bma->offset;
> @@ -4709,7 +4709,7 @@ xfs_bmapi_remap(
>  
>  	if (ifp->if_flags & XFS_IFBROOT) {
>  		cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
> -		cur->bc_private.b.flags = 0;
> +		cur->bc_ino.flags = 0;
>  	}
>  
>  	got.br_startoff = bno;
> @@ -5364,7 +5364,7 @@ __xfs_bunmapi(
>  	if (ifp->if_flags & XFS_IFBROOT) {
>  		ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE);
>  		cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
> -		cur->bc_private.b.flags = 0;
> +		cur->bc_ino.flags = 0;
>  	} else
>  		cur = NULL;
>  
> @@ -5620,7 +5620,7 @@ __xfs_bunmapi(
>  		xfs_trans_log_inode(tp, ip, logflags);
>  	if (cur) {
>  		if (!error)
> -			cur->bc_private.b.allocated = 0;
> +			cur->bc_ino.allocated = 0;
>  		xfs_btree_del_cursor(cur, error);
>  	}
>  	return error;
> @@ -5839,7 +5839,7 @@ xfs_bmap_collapse_extents(
>  
>  	if (ifp->if_flags & XFS_IFBROOT) {
>  		cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
> -		cur->bc_private.b.flags = 0;
> +		cur->bc_ino.flags = 0;
>  	}
>  
>  	if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) {
> @@ -5956,7 +5956,7 @@ xfs_bmap_insert_extents(
>  
>  	if (ifp->if_flags & XFS_IFBROOT) {
>  		cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
> -		cur->bc_private.b.flags = 0;
> +		cur->bc_ino.flags = 0;
>  	}
>  
>  	if (*next_fsb == NULLFSBLOCK) {
> @@ -6074,7 +6074,7 @@ xfs_bmap_split_extent(
>  
>  	if (ifp->if_flags & XFS_IFBROOT) {
>  		cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
> -		cur->bc_private.b.flags = 0;
> +		cur->bc_ino.flags = 0;
>  		error = xfs_bmbt_lookup_eq(cur, &got, &i);
>  		if (error)
>  			goto del_cursor;
> @@ -6133,7 +6133,7 @@ xfs_bmap_split_extent(
>  
>  del_cursor:
>  	if (cur) {
> -		cur->bc_private.b.allocated = 0;
> +		cur->bc_ino.allocated = 0;
>  		xfs_btree_del_cursor(cur, error);
>  	}
>  
> diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c
> index ffe608d2a2d9..71b60f2a9979 100644
> --- a/fs/xfs/libxfs/xfs_bmap_btree.c
> +++ b/fs/xfs/libxfs/xfs_bmap_btree.c
> @@ -166,13 +166,13 @@ xfs_bmbt_dup_cursor(
>  	struct xfs_btree_cur	*new;
>  
>  	new = xfs_bmbt_init_cursor(cur->bc_mp, cur->bc_tp,
> -			cur->bc_private.b.ip, cur->bc_private.b.whichfork);
> +			cur->bc_ino.ip, cur->bc_ino.whichfork);
>  
>  	/*
>  	 * Copy the firstblock, dfops, and flags values,
>  	 * since init cursor doesn't get them.
>  	 */
> -	new->bc_private.b.flags = cur->bc_private.b.flags;
> +	new->bc_ino.flags = cur->bc_ino.flags;
>  
>  	return new;
>  }
> @@ -183,12 +183,12 @@ xfs_bmbt_update_cursor(
>  	struct xfs_btree_cur	*dst)
>  {
>  	ASSERT((dst->bc_tp->t_firstblock != NULLFSBLOCK) ||
> -	       (dst->bc_private.b.ip->i_d.di_flags & XFS_DIFLAG_REALTIME));
> +	       (dst->bc_ino.ip->i_d.di_flags & XFS_DIFLAG_REALTIME));
>  
> -	dst->bc_private.b.allocated += src->bc_private.b.allocated;
> +	dst->bc_ino.allocated += src->bc_ino.allocated;
>  	dst->bc_tp->t_firstblock = src->bc_tp->t_firstblock;
>  
> -	src->bc_private.b.allocated = 0;
> +	src->bc_ino.allocated = 0;
>  }
>  
>  STATIC int
> @@ -205,8 +205,8 @@ xfs_bmbt_alloc_block(
>  	args.tp = cur->bc_tp;
>  	args.mp = cur->bc_mp;
>  	args.fsbno = cur->bc_tp->t_firstblock;
> -	xfs_rmap_ino_bmbt_owner(&args.oinfo, cur->bc_private.b.ip->i_ino,
> -			cur->bc_private.b.whichfork);
> +	xfs_rmap_ino_bmbt_owner(&args.oinfo, cur->bc_ino.ip->i_ino,
> +			cur->bc_ino.whichfork);
>  
>  	if (args.fsbno == NULLFSBLOCK) {
>  		args.fsbno = be64_to_cpu(start->l);
> @@ -230,7 +230,7 @@ xfs_bmbt_alloc_block(
>  	}
>  
>  	args.minlen = args.maxlen = args.prod = 1;
> -	args.wasdel = cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL;
> +	args.wasdel = cur->bc_ino.flags & XFS_BTCUR_BPRV_WASDEL;
>  	if (!args.wasdel && args.tp->t_blk_res == 0) {
>  		error = -ENOSPC;
>  		goto error0;
> @@ -259,10 +259,10 @@ xfs_bmbt_alloc_block(
>  
>  	ASSERT(args.len == 1);
>  	cur->bc_tp->t_firstblock = args.fsbno;
> -	cur->bc_private.b.allocated++;
> -	cur->bc_private.b.ip->i_d.di_nblocks++;
> -	xfs_trans_log_inode(args.tp, cur->bc_private.b.ip, XFS_ILOG_CORE);
> -	xfs_trans_mod_dquot_byino(args.tp, cur->bc_private.b.ip,
> +	cur->bc_ino.allocated++;
> +	cur->bc_ino.ip->i_d.di_nblocks++;
> +	xfs_trans_log_inode(args.tp, cur->bc_ino.ip, XFS_ILOG_CORE);
> +	xfs_trans_mod_dquot_byino(args.tp, cur->bc_ino.ip,
>  			XFS_TRANS_DQ_BCOUNT, 1L);
>  
>  	new->l = cpu_to_be64(args.fsbno);
> @@ -280,12 +280,12 @@ xfs_bmbt_free_block(
>  	struct xfs_buf		*bp)
>  {
>  	struct xfs_mount	*mp = cur->bc_mp;
> -	struct xfs_inode	*ip = cur->bc_private.b.ip;
> +	struct xfs_inode	*ip = cur->bc_ino.ip;
>  	struct xfs_trans	*tp = cur->bc_tp;
>  	xfs_fsblock_t		fsbno = XFS_DADDR_TO_FSB(mp, XFS_BUF_ADDR(bp));
>  	struct xfs_owner_info	oinfo;
>  
> -	xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_private.b.whichfork);
> +	xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_ino.whichfork);
>  	xfs_bmap_add_free(cur->bc_tp, fsbno, 1, &oinfo);
>  	ip->i_d.di_nblocks--;
>  
> @@ -302,8 +302,8 @@ xfs_bmbt_get_minrecs(
>  	if (level == cur->bc_nlevels - 1) {
>  		struct xfs_ifork	*ifp;
>  
> -		ifp = XFS_IFORK_PTR(cur->bc_private.b.ip,
> -				    cur->bc_private.b.whichfork);
> +		ifp = XFS_IFORK_PTR(cur->bc_ino.ip,
> +				    cur->bc_ino.whichfork);
>  
>  		return xfs_bmbt_maxrecs(cur->bc_mp,
>  					ifp->if_broot_bytes, level == 0) / 2;
> @@ -320,8 +320,8 @@ xfs_bmbt_get_maxrecs(
>  	if (level == cur->bc_nlevels - 1) {
>  		struct xfs_ifork	*ifp;
>  
> -		ifp = XFS_IFORK_PTR(cur->bc_private.b.ip,
> -				    cur->bc_private.b.whichfork);
> +		ifp = XFS_IFORK_PTR(cur->bc_ino.ip,
> +				    cur->bc_ino.whichfork);
>  
>  		return xfs_bmbt_maxrecs(cur->bc_mp,
>  					ifp->if_broot_bytes, level == 0);
> @@ -347,7 +347,7 @@ xfs_bmbt_get_dmaxrecs(
>  {
>  	if (level != cur->bc_nlevels - 1)
>  		return cur->bc_mp->m_bmap_dmxr[level != 0];
> -	return xfs_bmdr_maxrecs(cur->bc_private.b.forksize, level == 0);
> +	return xfs_bmdr_maxrecs(cur->bc_ino.forksize, level == 0);
>  }
>  
>  STATIC void
> @@ -566,11 +566,11 @@ xfs_bmbt_init_cursor(
>  	if (xfs_sb_version_hascrc(&mp->m_sb))
>  		cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
>  
> -	cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork);
> -	cur->bc_private.b.ip = ip;
> -	cur->bc_private.b.allocated = 0;
> -	cur->bc_private.b.flags = 0;
> -	cur->bc_private.b.whichfork = whichfork;
> +	cur->bc_ino.forksize = XFS_IFORK_SIZE(ip, whichfork);
> +	cur->bc_ino.ip = ip;
> +	cur->bc_ino.allocated = 0;
> +	cur->bc_ino.flags = 0;
> +	cur->bc_ino.whichfork = whichfork;
>  
>  	return cur;
>  }
> @@ -644,7 +644,7 @@ xfs_bmbt_change_owner(
>  	cur = xfs_bmbt_init_cursor(ip->i_mount, tp, ip, whichfork);
>  	if (!cur)
>  		return -ENOMEM;
> -	cur->bc_private.b.flags |= XFS_BTCUR_BPRV_INVALID_OWNER;
> +	cur->bc_ino.flags |= XFS_BTCUR_BPRV_INVALID_OWNER;
>  
>  	error = xfs_btree_change_owner(cur, new_owner, buffer_list);
>  	xfs_btree_del_cursor(cur, error);
> diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
> index 7681d48a2b13..8c6e128c8ae8 100644
> --- a/fs/xfs/libxfs/xfs_btree.c
> +++ b/fs/xfs/libxfs/xfs_btree.c
> @@ -234,8 +234,8 @@ xfs_btree_check_ptr(
>  			return 0;
>  		xfs_err(cur->bc_mp,
>  "Inode %llu fork %d: Corrupt btree %d pointer at level %d index %d.",
> -				cur->bc_private.b.ip->i_ino,
> -				cur->bc_private.b.whichfork, cur->bc_btnum,
> +				cur->bc_ino.ip->i_ino,
> +				cur->bc_ino.whichfork, cur->bc_btnum,
>  				level, index);
>  	} else {
>  		if (xfs_btree_check_sptr(cur, be32_to_cpu((&ptr->s)[index]),
> @@ -378,7 +378,7 @@ xfs_btree_del_cursor(
>  	 * allocated indirect blocks' accounting.
>  	 */
>  	ASSERT(cur->bc_btnum != XFS_BTNUM_BMAP ||
> -	       cur->bc_private.b.allocated == 0);
> +	       cur->bc_ino.allocated == 0);
>  	/*
>  	 * Free the cursor.
>  	 */
> @@ -654,7 +654,7 @@ xfs_btree_get_iroot(
>  {
>  	struct xfs_ifork	*ifp;
>  
> -	ifp = XFS_IFORK_PTR(cur->bc_private.b.ip, cur->bc_private.b.whichfork);
> +	ifp = XFS_IFORK_PTR(cur->bc_ino.ip, cur->bc_ino.whichfork);
>  	return (struct xfs_btree_block *)ifp->if_broot;
>  }
>  
> @@ -1144,7 +1144,7 @@ xfs_btree_init_block_cur(
>  	 * code.
>  	 */
>  	if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
> -		owner = cur->bc_private.b.ip->i_ino;
> +		owner = cur->bc_ino.ip->i_ino;
>  	else
>  		owner = cur->bc_ag.agno;
>  
> @@ -1393,8 +1393,8 @@ xfs_btree_log_keys(
>  				  xfs_btree_key_offset(cur, first),
>  				  xfs_btree_key_offset(cur, last + 1) - 1);
>  	} else {
> -		xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip,
> -				xfs_ilog_fbroot(cur->bc_private.b.whichfork));
> +		xfs_trans_log_inode(cur->bc_tp, cur->bc_ino.ip,
> +				xfs_ilog_fbroot(cur->bc_ino.whichfork));
>  	}
>  }
>  
> @@ -1436,8 +1436,8 @@ xfs_btree_log_ptrs(
>  				xfs_btree_ptr_offset(cur, first, level),
>  				xfs_btree_ptr_offset(cur, last + 1, level) - 1);
>  	} else {
> -		xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip,
> -			xfs_ilog_fbroot(cur->bc_private.b.whichfork));
> +		xfs_trans_log_inode(cur->bc_tp, cur->bc_ino.ip,
> +			xfs_ilog_fbroot(cur->bc_ino.whichfork));
>  	}
>  
>  }
> @@ -1505,8 +1505,8 @@ xfs_btree_log_block(
>  		xfs_trans_buf_set_type(cur->bc_tp, bp, XFS_BLFT_BTREE_BUF);
>  		xfs_trans_log_buf(cur->bc_tp, bp, first, last);
>  	} else {
> -		xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip,
> -			xfs_ilog_fbroot(cur->bc_private.b.whichfork));
> +		xfs_trans_log_inode(cur->bc_tp, cur->bc_ino.ip,
> +			xfs_ilog_fbroot(cur->bc_ino.whichfork));
>  	}
>  }
>  
> @@ -1743,10 +1743,10 @@ xfs_btree_lookup_get_block(
>  
>  	/* Check the inode owner since the verifiers don't. */
>  	if (xfs_sb_version_hascrc(&cur->bc_mp->m_sb) &&
> -	    !(cur->bc_private.b.flags & XFS_BTCUR_BPRV_INVALID_OWNER) &&
> +	    !(cur->bc_ino.flags & XFS_BTCUR_BPRV_INVALID_OWNER) &&
>  	    (cur->bc_flags & XFS_BTREE_LONG_PTRS) &&
>  	    be64_to_cpu((*blkp)->bb_u.l.bb_owner) !=
> -			cur->bc_private.b.ip->i_ino)
> +			cur->bc_ino.ip->i_ino)
>  		goto out_bad;
>  
>  	/* Did we get the level we were looking for? */
> @@ -2938,9 +2938,9 @@ xfs_btree_new_iroot(
>  
>  	xfs_btree_copy_ptrs(cur, pp, &nptr, 1);
>  
> -	xfs_iroot_realloc(cur->bc_private.b.ip,
> +	xfs_iroot_realloc(cur->bc_ino.ip,
>  			  1 - xfs_btree_get_numrecs(cblock),
> -			  cur->bc_private.b.whichfork);
> +			  cur->bc_ino.whichfork);
>  
>  	xfs_btree_setbuf(cur, level, cbp);
>  
> @@ -2953,7 +2953,7 @@ xfs_btree_new_iroot(
>  	xfs_btree_log_ptrs(cur, cbp, 1, be16_to_cpu(cblock->bb_numrecs));
>  
>  	*logflags |=
> -		XFS_ILOG_CORE | xfs_ilog_fbroot(cur->bc_private.b.whichfork);
> +		XFS_ILOG_CORE | xfs_ilog_fbroot(cur->bc_ino.whichfork);
>  	*stat = 1;
>  	return 0;
>  error0:
> @@ -3105,11 +3105,11 @@ xfs_btree_make_block_unfull(
>  
>  	if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) &&
>  	    level == cur->bc_nlevels - 1) {
> -		struct xfs_inode *ip = cur->bc_private.b.ip;
> +		struct xfs_inode *ip = cur->bc_ino.ip;
>  
>  		if (numrecs < cur->bc_ops->get_dmaxrecs(cur, level)) {
>  			/* A root block that can be made bigger. */
> -			xfs_iroot_realloc(ip, 1, cur->bc_private.b.whichfork);
> +			xfs_iroot_realloc(ip, 1, cur->bc_ino.whichfork);
>  			*stat = 1;
>  		} else {
>  			/* A root block that needs replacing */
> @@ -3455,8 +3455,8 @@ STATIC int
>  xfs_btree_kill_iroot(
>  	struct xfs_btree_cur	*cur)
>  {
> -	int			whichfork = cur->bc_private.b.whichfork;
> -	struct xfs_inode	*ip = cur->bc_private.b.ip;
> +	int			whichfork = cur->bc_ino.whichfork;
> +	struct xfs_inode	*ip = cur->bc_ino.ip;
>  	struct xfs_ifork	*ifp = XFS_IFORK_PTR(ip, whichfork);
>  	struct xfs_btree_block	*block;
>  	struct xfs_btree_block	*cblock;
> @@ -3514,8 +3514,8 @@ xfs_btree_kill_iroot(
>  
>  	index = numrecs - cur->bc_ops->get_maxrecs(cur, level);
>  	if (index) {
> -		xfs_iroot_realloc(cur->bc_private.b.ip, index,
> -				  cur->bc_private.b.whichfork);
> +		xfs_iroot_realloc(cur->bc_ino.ip, index,
> +				  cur->bc_ino.whichfork);
>  		block = ifp->if_broot;
>  	}
>  
> @@ -3544,7 +3544,7 @@ xfs_btree_kill_iroot(
>  	cur->bc_bufs[level - 1] = NULL;
>  	be16_add_cpu(&block->bb_level, -1);
>  	xfs_trans_log_inode(cur->bc_tp, ip,
> -		XFS_ILOG_CORE | xfs_ilog_fbroot(cur->bc_private.b.whichfork));
> +		XFS_ILOG_CORE | xfs_ilog_fbroot(cur->bc_ino.whichfork));
>  	cur->bc_nlevels--;
>  out0:
>  	return 0;
> @@ -3712,8 +3712,8 @@ xfs_btree_delrec(
>  	 */
>  	if (level == cur->bc_nlevels - 1) {
>  		if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) {
> -			xfs_iroot_realloc(cur->bc_private.b.ip, -1,
> -					  cur->bc_private.b.whichfork);
> +			xfs_iroot_realloc(cur->bc_ino.ip, -1,
> +					  cur->bc_ino.whichfork);
>  
>  			error = xfs_btree_kill_iroot(cur);
>  			if (error)
> diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
> index 1c866594ec34..add8598eacd5 100644
> --- a/fs/xfs/scrub/bmap.c
> +++ b/fs/xfs/scrub/bmap.c
> @@ -374,7 +374,7 @@ xchk_bmapbt_rec(
>  	struct xfs_bmbt_irec	iext_irec;
>  	struct xfs_iext_cursor	icur;
>  	struct xchk_bmap_info	*info = bs->private;
> -	struct xfs_inode	*ip = bs->cur->bc_private.b.ip;
> +	struct xfs_inode	*ip = bs->cur->bc_ino.ip;
>  	struct xfs_buf		*bp = NULL;
>  	struct xfs_btree_block	*block;
>  	struct xfs_ifork	*ifp = XFS_IFORK_PTR(ip, info->whichfork);
> diff --git a/fs/xfs/scrub/trace.c b/fs/xfs/scrub/trace.c
> index 731111e1448c..2c6c248be823 100644
> --- a/fs/xfs/scrub/trace.c
> +++ b/fs/xfs/scrub/trace.c
> @@ -24,7 +24,7 @@ xchk_btree_cur_fsbno(
>  		return XFS_DADDR_TO_FSB(cur->bc_mp, cur->bc_bufs[level]->b_bn);
>  	else if (level == cur->bc_nlevels - 1 &&
>  		 cur->bc_flags & XFS_BTREE_LONG_PTRS)
> -		return XFS_INO_TO_FSB(cur->bc_mp, cur->bc_private.b.ip->i_ino);
> +		return XFS_INO_TO_FSB(cur->bc_mp, cur->bc_ino.ip->i_ino);
>  	else if (!(cur->bc_flags & XFS_BTREE_LONG_PTRS))
>  		return XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_ag.agno, 0);
>  	return NULLFSBLOCK;
> diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
> index 096203119934..e46f5cef90da 100644
> --- a/fs/xfs/scrub/trace.h
> +++ b/fs/xfs/scrub/trace.h
> @@ -379,7 +379,7 @@ TRACE_EVENT(xchk_ifork_btree_op_error,
>  		xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
>  		__entry->dev = sc->mp->m_super->s_dev;
>  		__entry->ino = sc->ip->i_ino;
> -		__entry->whichfork = cur->bc_private.b.whichfork;
> +		__entry->whichfork = cur->bc_ino.whichfork;
>  		__entry->type = sc->sm->sm_type;
>  		__entry->btnum = cur->bc_btnum;
>  		__entry->level = level;
> @@ -459,7 +459,7 @@ TRACE_EVENT(xchk_ifork_btree_error,
>  		xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
>  		__entry->dev = sc->mp->m_super->s_dev;
>  		__entry->ino = sc->ip->i_ino;
> -		__entry->whichfork = cur->bc_private.b.whichfork;
> +		__entry->whichfork = cur->bc_ino.whichfork;
>  		__entry->type = sc->sm->sm_type;
>  		__entry->btnum = cur->bc_btnum;
>  		__entry->level = level;
> 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 4/7] xfs: rename btree cursor private btree member flags
  2020-03-12  3:45 ` [PATCH 4/7] xfs: rename btree cursor private btree member flags Darrick J. Wong
@ 2020-03-12 10:42   ` Brian Foster
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Foster @ 2020-03-12 10:42 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, david, Dave Chinner

On Wed, Mar 11, 2020 at 08:45:07PM -0700, Darrick J. Wong wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> BPRV is not longer appropriate because bc_private is going away.
> Script:
> 
> $ sed -i 's/BTCUR_BPRV/BTCUR_BMBT/g' fs/xfs/*[ch] fs/xfs/*/*[ch]
> 
> With manual cleanup to the definitions in fs/xfs/libxfs/xfs_btree.h
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> [darrick: change "BC_BT" to "BTCUR_BMBT", fix subject line typo]
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/libxfs/xfs_bmap.c       |    8 ++++----
>  fs/xfs/libxfs/xfs_bmap_btree.c |    4 ++--
>  fs/xfs/libxfs/xfs_btree.c      |    2 +-
>  fs/xfs/libxfs/xfs_btree.h      |    4 ++--
>  4 files changed, 9 insertions(+), 9 deletions(-)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index fc8f6d65576c..8057486c02b5 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -690,7 +690,7 @@ xfs_bmap_extents_to_btree(
>  	 * Need a cursor.  Can't allocate until bb_level is filled in.
>  	 */
>  	cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
> -	cur->bc_ino.flags = wasdel ? XFS_BTCUR_BPRV_WASDEL : 0;
> +	cur->bc_ino.flags = wasdel ? XFS_BTCUR_BMBT_WASDEL : 0;
>  	/*
>  	 * Convert to a btree with two levels, one record in root.
>  	 */
> @@ -1528,7 +1528,7 @@ xfs_bmap_add_extent_delay_real(
>  
>  	ASSERT(!isnullstartblock(new->br_startblock));
>  	ASSERT(!bma->cur ||
> -	       (bma->cur->bc_ino.flags & XFS_BTCUR_BPRV_WASDEL));
> +	       (bma->cur->bc_ino.flags & XFS_BTCUR_BMBT_WASDEL));
>  
>  	XFS_STATS_INC(mp, xs_add_exlist);
>  
> @@ -2752,7 +2752,7 @@ xfs_bmap_add_extent_hole_real(
>  	struct xfs_bmbt_irec	old;
>  
>  	ASSERT(!isnullstartblock(new->br_startblock));
> -	ASSERT(!cur || !(cur->bc_ino.flags & XFS_BTCUR_BPRV_WASDEL));
> +	ASSERT(!cur || !(cur->bc_ino.flags & XFS_BTCUR_BMBT_WASDEL));
>  
>  	XFS_STATS_INC(mp, xs_add_exlist);
>  
> @@ -4188,7 +4188,7 @@ xfs_bmapi_allocate(
>  
>  	if (bma->cur)
>  		bma->cur->bc_ino.flags =
> -			bma->wasdel ? XFS_BTCUR_BPRV_WASDEL : 0;
> +			bma->wasdel ? XFS_BTCUR_BMBT_WASDEL : 0;
>  
>  	bma->got.br_startoff = bma->offset;
>  	bma->got.br_startblock = bma->blkno;
> diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c
> index 71b60f2a9979..295a59cf8840 100644
> --- a/fs/xfs/libxfs/xfs_bmap_btree.c
> +++ b/fs/xfs/libxfs/xfs_bmap_btree.c
> @@ -230,7 +230,7 @@ xfs_bmbt_alloc_block(
>  	}
>  
>  	args.minlen = args.maxlen = args.prod = 1;
> -	args.wasdel = cur->bc_ino.flags & XFS_BTCUR_BPRV_WASDEL;
> +	args.wasdel = cur->bc_ino.flags & XFS_BTCUR_BMBT_WASDEL;
>  	if (!args.wasdel && args.tp->t_blk_res == 0) {
>  		error = -ENOSPC;
>  		goto error0;
> @@ -644,7 +644,7 @@ xfs_bmbt_change_owner(
>  	cur = xfs_bmbt_init_cursor(ip->i_mount, tp, ip, whichfork);
>  	if (!cur)
>  		return -ENOMEM;
> -	cur->bc_ino.flags |= XFS_BTCUR_BPRV_INVALID_OWNER;
> +	cur->bc_ino.flags |= XFS_BTCUR_BMBT_INVALID_OWNER;
>  
>  	error = xfs_btree_change_owner(cur, new_owner, buffer_list);
>  	xfs_btree_del_cursor(cur, error);
> diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
> index 8c6e128c8ae8..4ef9f0b42c7f 100644
> --- a/fs/xfs/libxfs/xfs_btree.c
> +++ b/fs/xfs/libxfs/xfs_btree.c
> @@ -1743,7 +1743,7 @@ xfs_btree_lookup_get_block(
>  
>  	/* Check the inode owner since the verifiers don't. */
>  	if (xfs_sb_version_hascrc(&cur->bc_mp->m_sb) &&
> -	    !(cur->bc_ino.flags & XFS_BTCUR_BPRV_INVALID_OWNER) &&
> +	    !(cur->bc_ino.flags & XFS_BTCUR_BMBT_INVALID_OWNER) &&
>  	    (cur->bc_flags & XFS_BTREE_LONG_PTRS) &&
>  	    be64_to_cpu((*blkp)->bb_u.l.bb_owner) !=
>  			cur->bc_ino.ip->i_ino)
> diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
> index 4a1c98bdfaad..00a58ac8b696 100644
> --- a/fs/xfs/libxfs/xfs_btree.h
> +++ b/fs/xfs/libxfs/xfs_btree.h
> @@ -220,8 +220,8 @@ typedef struct xfs_btree_cur
>  			short		forksize;	/* fork's inode space */
>  			char		whichfork;	/* data or attr fork */
>  			char		flags;		/* flags */
> -#define	XFS_BTCUR_BPRV_WASDEL		(1<<0)		/* was delayed */
> -#define	XFS_BTCUR_BPRV_INVALID_OWNER	(1<<1)		/* for ext swap */
> +#define	XFS_BTCUR_BMBT_WASDEL	(1 << 0)		/* was delayed */
> +#define	XFS_BTCUR_BMBT_INVALID_OWNER	(1 << 1)		/* for ext swap */
>  		} b;
>  	}		bc_private;	/* per-btree type data */
>  #define bc_ag	bc_private.a
> 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 5/7] xfs: make btree cursor private union anonymous
  2020-03-12  3:45 ` [PATCH 5/7] xfs: make btree cursor private union anonymous Darrick J. Wong
@ 2020-03-12 10:49   ` Brian Foster
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Foster @ 2020-03-12 10:49 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, david, Dave Chinner

On Thu, Mar 12, 2020 at 03:45:14AM +0000, Darrick J. Wong wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> Rename the union and it's internal structures to the new name and
> remove the temporary defines that facilitated the change.
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/libxfs/xfs_btree.h |    8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
> index 00a58ac8b696..12a2bc93371d 100644
> --- a/fs/xfs/libxfs/xfs_btree.h
> +++ b/fs/xfs/libxfs/xfs_btree.h
> @@ -213,7 +213,7 @@ typedef struct xfs_btree_cur
>  			struct xfs_buf	*agbp;	/* agf/agi buffer pointer */
>  			xfs_agnumber_t	agno;	/* ag number */
>  			union xfs_btree_cur_private	priv;
> -		} a;
> +		} bc_ag;
>  		struct {			/* needed for BMAP */
>  			struct xfs_inode *ip;	/* pointer to our inode */
>  			int		allocated;	/* count of alloced */
> @@ -222,10 +222,8 @@ typedef struct xfs_btree_cur
>  			char		flags;		/* flags */
>  #define	XFS_BTCUR_BMBT_WASDEL	(1 << 0)		/* was delayed */
>  #define	XFS_BTCUR_BMBT_INVALID_OWNER	(1 << 1)		/* for ext swap */
> -		} b;
> -	}		bc_private;	/* per-btree type data */
> -#define bc_ag	bc_private.a
> -#define bc_ino	bc_private.b
> +		} bc_ino;
> +	};				/* per-btree type data */
>  } xfs_btree_cur_t;
>  
>  /* cursor flags */
> 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 6/7] xfs: make the btree cursor union members named structure
  2020-03-12  3:45 ` [PATCH 6/7] xfs: make the btree cursor union members named structure Darrick J. Wong
@ 2020-03-12 10:49   ` Brian Foster
  2020-03-12 23:44     ` Darrick J. Wong
  2020-03-13  4:32     ` Dave Chinner
  0 siblings, 2 replies; 17+ messages in thread
From: Brian Foster @ 2020-03-12 10:49 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, david, Dave Chinner

On Wed, Mar 11, 2020 at 08:45:20PM -0700, Darrick J. Wong wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> we need to name the btree cursor private structures to be able
> to pull them out of the deeply nested structure definition they are
> in now.
> 
> Based on code extracted from a patchset by Darrick Wong.
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  fs/xfs/libxfs/xfs_btree.h |   36 +++++++++++++++++++++---------------
>  1 file changed, 21 insertions(+), 15 deletions(-)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
> index 12a2bc93371d..9884f543eb51 100644
> --- a/fs/xfs/libxfs/xfs_btree.h
> +++ b/fs/xfs/libxfs/xfs_btree.h
> @@ -188,6 +188,24 @@ union xfs_btree_cur_private {
>  	} abt;
>  };
>  
> +/* Per-AG btree information. */
> +struct xfs_btree_cur_ag {
> +	struct xfs_buf			*agbp;
> +	xfs_agnumber_t			agno;
> +	union xfs_btree_cur_private	priv;
> +};
> +
> +/* Btree-in-inode cursor information */
> +struct xfs_btree_cur_ino {
> +	struct xfs_inode	*ip;
> +	int			allocated;
> +	short			forksize;
> +	char			whichfork;
> +	char			flags;
> +#define	XFS_BTCUR_BMBT_WASDEL	(1 << 0)
> +#define	XFS_BTCUR_BMBT_INVALID_OWNER	(1 << 1)
> +};
> +

Are all of the per-field comments dropped intentionally? These are
mostly self-explanatory, so either way:

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  /*
>   * Btree cursor structure.
>   * This collects all information needed by the btree code in one place.
> @@ -209,21 +227,9 @@ typedef struct xfs_btree_cur
>  	xfs_btnum_t	bc_btnum;	/* identifies which btree type */
>  	int		bc_statoff;	/* offset of btre stats array */
>  	union {
> -		struct {			/* needed for BNO, CNT, INO */
> -			struct xfs_buf	*agbp;	/* agf/agi buffer pointer */
> -			xfs_agnumber_t	agno;	/* ag number */
> -			union xfs_btree_cur_private	priv;
> -		} bc_ag;
> -		struct {			/* needed for BMAP */
> -			struct xfs_inode *ip;	/* pointer to our inode */
> -			int		allocated;	/* count of alloced */
> -			short		forksize;	/* fork's inode space */
> -			char		whichfork;	/* data or attr fork */
> -			char		flags;		/* flags */
> -#define	XFS_BTCUR_BMBT_WASDEL	(1 << 0)		/* was delayed */
> -#define	XFS_BTCUR_BMBT_INVALID_OWNER	(1 << 1)		/* for ext swap */
> -		} bc_ino;
> -	};				/* per-btree type data */
> +		struct xfs_btree_cur_ag	bc_ag;
> +		struct xfs_btree_cur_ino bc_ino;
> +	};
>  } xfs_btree_cur_t;
>  
>  /* cursor flags */
> 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 7/7] xfs: make the btree ag cursor private union anonymous
  2020-03-12  3:45 ` [PATCH 7/7] xfs: make the btree ag cursor private union anonymous Darrick J. Wong
@ 2020-03-12 10:49   ` Brian Foster
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Foster @ 2020-03-12 10:49 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, david, Dave Chinner

On Wed, Mar 11, 2020 at 08:45:27PM -0700, Darrick J. Wong wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> This is much less widely used than the bc_private union was, so this
> is done as a single patch. The named union xfs_btree_cur_private
> goes away and is embedded into the struct xfs_btree_cur_ag as an
> anonymous union, and the code is modified via this script:
> 
> $ sed -i 's/priv\.\([abt|refc]\)/\1/g' fs/xfs/*[ch] fs/xfs/*/*[ch]
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/libxfs/xfs_alloc.c          |   14 +++++++-------
>  fs/xfs/libxfs/xfs_alloc_btree.c    |    2 +-
>  fs/xfs/libxfs/xfs_btree.h          |   25 +++++++++++--------------
>  fs/xfs/libxfs/xfs_refcount.c       |   24 ++++++++++++------------
>  fs/xfs/libxfs/xfs_refcount_btree.c |    4 ++--
>  5 files changed, 33 insertions(+), 36 deletions(-)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index 10ed68dfef5d..337822115bbc 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -151,7 +151,7 @@ xfs_alloc_lookup_eq(
>  	cur->bc_rec.a.ar_startblock = bno;
>  	cur->bc_rec.a.ar_blockcount = len;
>  	error = xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat);
> -	cur->bc_ag.priv.abt.active = (*stat == 1);
> +	cur->bc_ag.abt.active = (*stat == 1);
>  	return error;
>  }
>  
> @@ -171,7 +171,7 @@ xfs_alloc_lookup_ge(
>  	cur->bc_rec.a.ar_startblock = bno;
>  	cur->bc_rec.a.ar_blockcount = len;
>  	error = xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat);
> -	cur->bc_ag.priv.abt.active = (*stat == 1);
> +	cur->bc_ag.abt.active = (*stat == 1);
>  	return error;
>  }
>  
> @@ -190,7 +190,7 @@ xfs_alloc_lookup_le(
>  	cur->bc_rec.a.ar_startblock = bno;
>  	cur->bc_rec.a.ar_blockcount = len;
>  	error = xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat);
> -	cur->bc_ag.priv.abt.active = (*stat == 1);
> +	cur->bc_ag.abt.active = (*stat == 1);
>  	return error;
>  }
>  
> @@ -198,7 +198,7 @@ static inline bool
>  xfs_alloc_cur_active(
>  	struct xfs_btree_cur	*cur)
>  {
> -	return cur && cur->bc_ag.priv.abt.active;
> +	return cur && cur->bc_ag.abt.active;
>  }
>  
>  /*
> @@ -908,7 +908,7 @@ xfs_alloc_cur_check(
>  		deactivate = true;
>  out:
>  	if (deactivate)
> -		cur->bc_ag.priv.abt.active = false;
> +		cur->bc_ag.abt.active = false;
>  	trace_xfs_alloc_cur_check(args->mp, cur->bc_btnum, bno, len, diff,
>  				  *new);
>  	return 0;
> @@ -1352,7 +1352,7 @@ xfs_alloc_walk_iter(
>  		if (error)
>  			return error;
>  		if (i == 0)
> -			cur->bc_ag.priv.abt.active = false;
> +			cur->bc_ag.abt.active = false;
>  
>  		if (count > 0)
>  			count--;
> @@ -1467,7 +1467,7 @@ xfs_alloc_ag_vextent_locality(
>  		if (error)
>  			return error;
>  		if (i) {
> -			acur->cnt->bc_ag.priv.abt.active = true;
> +			acur->cnt->bc_ag.abt.active = true;
>  			fbcur = acur->cnt;
>  			fbinc = false;
>  		}
> diff --git a/fs/xfs/libxfs/xfs_alloc_btree.c b/fs/xfs/libxfs/xfs_alloc_btree.c
> index 92d30c19519d..a28041fdf4c0 100644
> --- a/fs/xfs/libxfs/xfs_alloc_btree.c
> +++ b/fs/xfs/libxfs/xfs_alloc_btree.c
> @@ -507,7 +507,7 @@ xfs_allocbt_init_cursor(
>  
>  	cur->bc_ag.agbp = agbp;
>  	cur->bc_ag.agno = agno;
> -	cur->bc_ag.priv.abt.active = false;
> +	cur->bc_ag.abt.active = false;
>  
>  	if (xfs_sb_version_hascrc(&mp->m_sb))
>  		cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
> diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
> index 9884f543eb51..0d10bbd5223a 100644
> --- a/fs/xfs/libxfs/xfs_btree.h
> +++ b/fs/xfs/libxfs/xfs_btree.h
> @@ -177,22 +177,19 @@ union xfs_btree_irec {
>  	struct xfs_refcount_irec	rc;
>  };
>  
> -/* Per-AG btree private information. */
> -union xfs_btree_cur_private {
> -	struct {
> -		unsigned long	nr_ops;		/* # record updates */
> -		int		shape_changes;	/* # of extent splits */
> -	} refc;
> -	struct {
> -		bool		active;		/* allocation cursor state */
> -	} abt;
> -};
> -
>  /* Per-AG btree information. */
>  struct xfs_btree_cur_ag {
> -	struct xfs_buf			*agbp;
> -	xfs_agnumber_t			agno;
> -	union xfs_btree_cur_private	priv;
> +	struct xfs_buf		*agbp;
> +	xfs_agnumber_t		agno;
> +	union {
> +		struct {
> +			unsigned long nr_ops;	/* # record updates */
> +			int	shape_changes;	/* # of extent splits */
> +		} refc;
> +		struct {
> +			bool	active;		/* allocation cursor state */
> +		} abt;
> +	};
>  };
>  
>  /* Btree-in-inode cursor information */
> diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
> index ef3e706f1d94..2076627243b0 100644
> --- a/fs/xfs/libxfs/xfs_refcount.c
> +++ b/fs/xfs/libxfs/xfs_refcount.c
> @@ -883,7 +883,7 @@ xfs_refcount_still_have_space(
>  {
>  	unsigned long			overhead;
>  
> -	overhead = cur->bc_ag.priv.refc.shape_changes *
> +	overhead = cur->bc_ag.refc.shape_changes *
>  			xfs_allocfree_log_count(cur->bc_mp, 1);
>  	overhead *= cur->bc_mp->m_sb.sb_blocksize;
>  
> @@ -891,17 +891,17 @@ xfs_refcount_still_have_space(
>  	 * Only allow 2 refcount extent updates per transaction if the
>  	 * refcount continue update "error" has been injected.
>  	 */
> -	if (cur->bc_ag.priv.refc.nr_ops > 2 &&
> +	if (cur->bc_ag.refc.nr_ops > 2 &&
>  	    XFS_TEST_ERROR(false, cur->bc_mp,
>  			XFS_ERRTAG_REFCOUNT_CONTINUE_UPDATE))
>  		return false;
>  
> -	if (cur->bc_ag.priv.refc.nr_ops == 0)
> +	if (cur->bc_ag.refc.nr_ops == 0)
>  		return true;
>  	else if (overhead > cur->bc_tp->t_log_res)
>  		return false;
>  	return  cur->bc_tp->t_log_res - overhead >
> -		cur->bc_ag.priv.refc.nr_ops * XFS_REFCOUNT_ITEM_OVERHEAD;
> +		cur->bc_ag.refc.nr_ops * XFS_REFCOUNT_ITEM_OVERHEAD;
>  }
>  
>  /*
> @@ -968,7 +968,7 @@ xfs_refcount_adjust_extents(
>  					error = -EFSCORRUPTED;
>  					goto out_error;
>  				}
> -				cur->bc_ag.priv.refc.nr_ops++;
> +				cur->bc_ag.refc.nr_ops++;
>  			} else {
>  				fsbno = XFS_AGB_TO_FSB(cur->bc_mp,
>  						cur->bc_ag.agno,
> @@ -1003,7 +1003,7 @@ xfs_refcount_adjust_extents(
>  			error = xfs_refcount_update(cur, &ext);
>  			if (error)
>  				goto out_error;
> -			cur->bc_ag.priv.refc.nr_ops++;
> +			cur->bc_ag.refc.nr_ops++;
>  		} else if (ext.rc_refcount == 1) {
>  			error = xfs_refcount_delete(cur, &found_rec);
>  			if (error)
> @@ -1012,7 +1012,7 @@ xfs_refcount_adjust_extents(
>  				error = -EFSCORRUPTED;
>  				goto out_error;
>  			}
> -			cur->bc_ag.priv.refc.nr_ops++;
> +			cur->bc_ag.refc.nr_ops++;
>  			goto advloop;
>  		} else {
>  			fsbno = XFS_AGB_TO_FSB(cur->bc_mp,
> @@ -1088,7 +1088,7 @@ xfs_refcount_adjust(
>  	if (shape_changed)
>  		shape_changes++;
>  	if (shape_changes)
> -		cur->bc_ag.priv.refc.shape_changes++;
> +		cur->bc_ag.refc.shape_changes++;
>  
>  	/* Now that we've taken care of the ends, adjust the middle extents */
>  	error = xfs_refcount_adjust_extents(cur, new_agbno, new_aglen,
> @@ -1166,8 +1166,8 @@ xfs_refcount_finish_one(
>  	 */
>  	rcur = *pcur;
>  	if (rcur != NULL && rcur->bc_ag.agno != agno) {
> -		nr_ops = rcur->bc_ag.priv.refc.nr_ops;
> -		shape_changes = rcur->bc_ag.priv.refc.shape_changes;
> +		nr_ops = rcur->bc_ag.refc.nr_ops;
> +		shape_changes = rcur->bc_ag.refc.shape_changes;
>  		xfs_refcount_finish_one_cleanup(tp, rcur, 0);
>  		rcur = NULL;
>  		*pcur = NULL;
> @@ -1183,8 +1183,8 @@ xfs_refcount_finish_one(
>  			error = -ENOMEM;
>  			goto out_cur;
>  		}
> -		rcur->bc_ag.priv.refc.nr_ops = nr_ops;
> -		rcur->bc_ag.priv.refc.shape_changes = shape_changes;
> +		rcur->bc_ag.refc.nr_ops = nr_ops;
> +		rcur->bc_ag.refc.shape_changes = shape_changes;
>  	}
>  	*pcur = rcur;
>  
> diff --git a/fs/xfs/libxfs/xfs_refcount_btree.c b/fs/xfs/libxfs/xfs_refcount_btree.c
> index bf1a4cb3c7ac..e07a2c45f8ec 100644
> --- a/fs/xfs/libxfs/xfs_refcount_btree.c
> +++ b/fs/xfs/libxfs/xfs_refcount_btree.c
> @@ -340,8 +340,8 @@ xfs_refcountbt_init_cursor(
>  	cur->bc_ag.agno = agno;
>  	cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;
>  
> -	cur->bc_ag.priv.refc.nr_ops = 0;
> -	cur->bc_ag.priv.refc.shape_changes = 0;
> +	cur->bc_ag.refc.nr_ops = 0;
> +	cur->bc_ag.refc.shape_changes = 0;
>  
>  	return cur;
>  }
> 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 6/7] xfs: make the btree cursor union members named structure
  2020-03-12 10:49   ` Brian Foster
@ 2020-03-12 23:44     ` Darrick J. Wong
  2020-03-13  4:32     ` Dave Chinner
  1 sibling, 0 replies; 17+ messages in thread
From: Darrick J. Wong @ 2020-03-12 23:44 UTC (permalink / raw)
  To: Brian Foster; +Cc: linux-xfs, david, Dave Chinner

On Thu, Mar 12, 2020 at 06:49:29AM -0400, Brian Foster wrote:
> On Wed, Mar 11, 2020 at 08:45:20PM -0700, Darrick J. Wong wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> > 
> > we need to name the btree cursor private structures to be able
> > to pull them out of the deeply nested structure definition they are
> > in now.
> > 
> > Based on code extracted from a patchset by Darrick Wong.
> > 
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  fs/xfs/libxfs/xfs_btree.h |   36 +++++++++++++++++++++---------------
> >  1 file changed, 21 insertions(+), 15 deletions(-)
> > 
> > 
> > diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
> > index 12a2bc93371d..9884f543eb51 100644
> > --- a/fs/xfs/libxfs/xfs_btree.h
> > +++ b/fs/xfs/libxfs/xfs_btree.h
> > @@ -188,6 +188,24 @@ union xfs_btree_cur_private {
> >  	} abt;
> >  };
> >  
> > +/* Per-AG btree information. */
> > +struct xfs_btree_cur_ag {
> > +	struct xfs_buf			*agbp;
> > +	xfs_agnumber_t			agno;
> > +	union xfs_btree_cur_private	priv;
> > +};
> > +
> > +/* Btree-in-inode cursor information */
> > +struct xfs_btree_cur_ino {
> > +	struct xfs_inode	*ip;
> > +	int			allocated;
> > +	short			forksize;
> > +	char			whichfork;
> > +	char			flags;
> > +#define	XFS_BTCUR_BMBT_WASDEL	(1 << 0)
> > +#define	XFS_BTCUR_BMBT_INVALID_OWNER	(1 << 1)
> > +};
> > +
> 
> Are all of the per-field comments dropped intentionally? These are
> mostly self-explanatory, so either way:

I think the comments were not that valuable, and that I can perhaps
improve them:

/* We are converting a delalloc reservation */
#define	XFS_BTCUR_BMBT_WASDEL		(1 << 0)

/* For extent swap, ignore owner check in verifier */
#define	XFS_BTCUR_BMBT_INVALID_OWNER	(1 << 1)

Anyway, thanks for reviewing this series.

--D

> Reviewed-by: Brian Foster <bfoster@redhat.com>
> 
> >  /*
> >   * Btree cursor structure.
> >   * This collects all information needed by the btree code in one place.
> > @@ -209,21 +227,9 @@ typedef struct xfs_btree_cur
> >  	xfs_btnum_t	bc_btnum;	/* identifies which btree type */
> >  	int		bc_statoff;	/* offset of btre stats array */
> >  	union {
> > -		struct {			/* needed for BNO, CNT, INO */
> > -			struct xfs_buf	*agbp;	/* agf/agi buffer pointer */
> > -			xfs_agnumber_t	agno;	/* ag number */
> > -			union xfs_btree_cur_private	priv;
> > -		} bc_ag;
> > -		struct {			/* needed for BMAP */
> > -			struct xfs_inode *ip;	/* pointer to our inode */
> > -			int		allocated;	/* count of alloced */
> > -			short		forksize;	/* fork's inode space */
> > -			char		whichfork;	/* data or attr fork */
> > -			char		flags;		/* flags */
> > -#define	XFS_BTCUR_BMBT_WASDEL	(1 << 0)		/* was delayed */
> > -#define	XFS_BTCUR_BMBT_INVALID_OWNER	(1 << 1)		/* for ext swap */
> > -		} bc_ino;
> > -	};				/* per-btree type data */
> > +		struct xfs_btree_cur_ag	bc_ag;
> > +		struct xfs_btree_cur_ino bc_ino;
> > +	};
> >  } xfs_btree_cur_t;
> >  
> >  /* cursor flags */
> > 
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 6/7] xfs: make the btree cursor union members named structure
  2020-03-12 10:49   ` Brian Foster
  2020-03-12 23:44     ` Darrick J. Wong
@ 2020-03-13  4:32     ` Dave Chinner
  1 sibling, 0 replies; 17+ messages in thread
From: Dave Chinner @ 2020-03-13  4:32 UTC (permalink / raw)
  To: Brian Foster; +Cc: Darrick J. Wong, linux-xfs, Dave Chinner

On Thu, Mar 12, 2020 at 06:49:29AM -0400, Brian Foster wrote:
> On Wed, Mar 11, 2020 at 08:45:20PM -0700, Darrick J. Wong wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> > 
> > we need to name the btree cursor private structures to be able
> > to pull them out of the deeply nested structure definition they are
> > in now.
> > 
> > Based on code extracted from a patchset by Darrick Wong.
> > 
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  fs/xfs/libxfs/xfs_btree.h |   36 +++++++++++++++++++++---------------
> >  1 file changed, 21 insertions(+), 15 deletions(-)
> > 
> > 
> > diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
> > index 12a2bc93371d..9884f543eb51 100644
> > --- a/fs/xfs/libxfs/xfs_btree.h
> > +++ b/fs/xfs/libxfs/xfs_btree.h
> > @@ -188,6 +188,24 @@ union xfs_btree_cur_private {
> >  	} abt;
> >  };
> >  
> > +/* Per-AG btree information. */
> > +struct xfs_btree_cur_ag {
> > +	struct xfs_buf			*agbp;
> > +	xfs_agnumber_t			agno;
> > +	union xfs_btree_cur_private	priv;
> > +};
> > +
> > +/* Btree-in-inode cursor information */
> > +struct xfs_btree_cur_ino {
> > +	struct xfs_inode	*ip;
> > +	int			allocated;
> > +	short			forksize;
> > +	char			whichfork;
> > +	char			flags;
> > +#define	XFS_BTCUR_BMBT_WASDEL	(1 << 0)
> > +#define	XFS_BTCUR_BMBT_INVALID_OWNER	(1 << 1)
> > +};
> > +
> 
> Are all of the per-field comments dropped intentionally? These are
> mostly self-explanatory, so either way:

Yeah, it was intentional, because the comments were redundant and
the meaning is clear from both the name and the use of the variable.
Comments don't always add value...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2020-03-13  4:32 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12  3:44 [PATCH v2 0/7] xfs: make btree cursor private unions anonymous Darrick J. Wong
2020-03-12  3:44 ` [PATCH 1/7] xfs: introduce new private btree cursor names Darrick J. Wong
2020-03-12 10:41   ` Brian Foster
2020-03-12  3:44 ` [PATCH 2/7] xfs: convert btree cursor ag-private member name Darrick J. Wong
2020-03-12 10:42   ` Brian Foster
2020-03-12  3:45 ` [PATCH 3/7] xfs: convert btree cursor inode-private member names Darrick J. Wong
2020-03-12 10:42   ` Brian Foster
2020-03-12  3:45 ` [PATCH 4/7] xfs: rename btree cursor private btree member flags Darrick J. Wong
2020-03-12 10:42   ` Brian Foster
2020-03-12  3:45 ` [PATCH 5/7] xfs: make btree cursor private union anonymous Darrick J. Wong
2020-03-12 10:49   ` Brian Foster
2020-03-12  3:45 ` [PATCH 6/7] xfs: make the btree cursor union members named structure Darrick J. Wong
2020-03-12 10:49   ` Brian Foster
2020-03-12 23:44     ` Darrick J. Wong
2020-03-13  4:32     ` Dave Chinner
2020-03-12  3:45 ` [PATCH 7/7] xfs: make the btree ag cursor private union anonymous Darrick J. Wong
2020-03-12 10:49   ` Brian Foster

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.