summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2020-03-10 17:57:07 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-03-11 10:39:33 -0700
commite81b8b9dc5b55ff24327478e32a9ae2c25335c19 (patch)
tree7e68b8a6c4492040fa32eb0313c52a6ef81576d6
parent85ce2c1288ab13842c12eea843fa0d3a10c328f1 (diff)
xfs: make the btree cursor union members named structure
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>
-rw-r--r--fs/xfs/libxfs/xfs_btree.h36
1 files 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 */