diff options
author | Christoph Hellwig <hch@lst.de> | 2024-02-22 23:35:21 +0300 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2024-02-22 23:35:21 +0300 |
commit | 07b7f2e3172b97da2a7ac273ecbaf173cc09a9f4 (patch) | |
tree | 36e7dad7ba7f84375744656e6565d80c9043a441 /fs/xfs/libxfs/xfs_btree.h | |
parent | 90cfae818dac5227e94e21d0f5250e098432723e (diff) | |
download | linux-07b7f2e3172b97da2a7ac273ecbaf173cc09a9f4.tar.xz |
xfs: move the btree stats offset into struct btree_ops
The statistics offset is completely static, move it into the btree_ops
structure instead of the cursor.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/libxfs/xfs_btree.h')
-rw-r--r-- | fs/xfs/libxfs/xfs_btree.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h index 39df108a32ef..2a1f30a849f5 100644 --- a/fs/xfs/libxfs/xfs_btree.h +++ b/fs/xfs/libxfs/xfs_btree.h @@ -87,9 +87,11 @@ uint32_t xfs_btree_magic(struct xfs_mount *mp, const struct xfs_btree_ops *ops); * Generic stats interface */ #define XFS_BTREE_STATS_INC(cur, stat) \ - XFS_STATS_INC_OFF((cur)->bc_mp, (cur)->bc_statoff + __XBTS_ ## stat) + XFS_STATS_INC_OFF((cur)->bc_mp, \ + (cur)->bc_ops->statoff + __XBTS_ ## stat) #define XFS_BTREE_STATS_ADD(cur, stat, val) \ - XFS_STATS_ADD_OFF((cur)->bc_mp, (cur)->bc_statoff + __XBTS_ ## stat, val) + XFS_STATS_ADD_OFF((cur)->bc_mp, \ + (cur)->bc_ops->statoff + __XBTS_ ## stat, val) enum xbtree_key_contig { XBTREE_KEY_GAP = 0, @@ -123,6 +125,9 @@ struct xfs_btree_ops { /* LRU refcount to set on each btree buffer created */ unsigned int lru_refs; + /* offset of btree stats array */ + unsigned int statoff; + /* cursor operations */ struct xfs_btree_cur *(*dup_cursor)(struct xfs_btree_cur *); void (*update_cursor)(struct xfs_btree_cur *src, @@ -280,7 +285,6 @@ struct xfs_btree_cur union xfs_btree_irec bc_rec; /* current insert/search record value */ uint8_t bc_nlevels; /* number of levels in the tree */ uint8_t bc_maxlevels; /* maximum levels for this btree type */ - int bc_statoff; /* offset of btree stats array */ /* * Short btree pointers need an agno to be able to turn the pointers |