提交 68422d90 编写于 作者: D Dave Chinner 提交者: Darrick J. Wong

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: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
上级 35289073
...@@ -188,6 +188,27 @@ union xfs_btree_cur_private { ...@@ -188,6 +188,27 @@ union xfs_btree_cur_private {
} abt; } 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;
/* 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)
};
/* /*
* Btree cursor structure. * Btree cursor structure.
* This collects all information needed by the btree code in one place. * This collects all information needed by the btree code in one place.
...@@ -209,21 +230,9 @@ typedef struct xfs_btree_cur ...@@ -209,21 +230,9 @@ typedef struct xfs_btree_cur
xfs_btnum_t bc_btnum; /* identifies which btree type */ xfs_btnum_t bc_btnum; /* identifies which btree type */
int bc_statoff; /* offset of btre stats array */ int bc_statoff; /* offset of btre stats array */
union { union {
struct { /* needed for BNO, CNT, INO */ struct xfs_btree_cur_ag bc_ag;
struct xfs_buf *agbp; /* agf/agi buffer pointer */ struct xfs_btree_cur_ino bc_ino;
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 */
} xfs_btree_cur_t; } xfs_btree_cur_t;
/* cursor flags */ /* cursor flags */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册