summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_btree.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2021-06-02 10:48:24 +1000
committerDave Chinner <david@fromorbit.com>2021-06-02 10:48:24 +1000
commitbe9fb17d88f08af648a89784d30dbac83d893154 (patch)
tree7609c3af495c79f3d2c183b1f9e9cfdc4cde38a8 /fs/xfs/libxfs/xfs_btree.h
parent58d43a7e3263766ade4974c86118e6b5737ea259 (diff)
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.h11
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;