diff options
author | Dave Chinner <dchinner@redhat.com> | 2021-06-02 02:48:24 +0200 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2021-06-02 02:48:24 +0200 |
commit | be9fb17d88f08af648a89784d30dbac83d893154 (patch) | |
tree | 7609c3af495c79f3d2c183b1f9e9cfdc4cde38a8 /fs/xfs/libxfs/xfs_btree.h | |
parent | xfs: pass perags around in fsmap data dev functions (diff) | |
download | linux-be9fb17d88f08af648a89784d30dbac83d893154.tar.xz linux-be9fb17d88f08af648a89784d30dbac83d893154.zip |
xfs: add a perag to the btree cursor
Which will eventually completely replace the agno in it.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_btree.h')
-rw-r--r-- | fs/xfs/libxfs/xfs_btree.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h index 10e50cbacacf..e71f33f1f111 100644 --- a/fs/xfs/libxfs/xfs_btree.h +++ b/fs/xfs/libxfs/xfs_btree.h @@ -11,6 +11,7 @@ struct xfs_inode; struct xfs_mount; struct xfs_trans; struct xfs_ifork; +struct xfs_perag; extern kmem_zone_t *xfs_btree_cur_zone; @@ -180,11 +181,12 @@ union xfs_btree_irec { /* Per-AG btree information. */ struct xfs_btree_cur_ag { + xfs_agnumber_t agno; + struct xfs_perag *pag; union { struct xfs_buf *agbp; struct xbtree_afakeroot *afake; /* for staging cursor */ }; - xfs_agnumber_t agno; union { struct { unsigned long nr_ops; /* # record updates */ @@ -231,6 +233,13 @@ typedef struct xfs_btree_cur uint8_t bc_blocklog; /* log2(blocksize) of btree blocks */ xfs_btnum_t bc_btnum; /* identifies which btree type */ int bc_statoff; /* offset of btre stats array */ + + /* + * Short btree pointers need an agno to be able to turn the pointers + * into physical addresses for IO, so the btree cursor switches between + * bc_ino and bc_ag based on whether XFS_BTREE_LONG_PTRS is set for the + * cursor. + */ union { struct xfs_btree_cur_ag bc_ag; struct xfs_btree_cur_ino bc_ino; |