summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_btree.h
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-09-23 14:10:59 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-10-22 16:40:56 -0700
commitcf94cb4944fb956a8d48ef228cb76b8c37182580 (patch)
treecb7eed8e397fff94fe4edc37f735fd622253f67f /fs/xfs/libxfs/xfs_btree.h
parent3396bc20567d6592ae2cb684e3abd8b70667d851 (diff)
xfs: check absolute maximum nlevels for each btree type
Add code for all five btree types so that we can compute the absolute maximum possible btree height for each btree type, and then check that none of them exceed XFS_BTREE_CUR_ZONE_MAXLEVELS. The code to do the actual checking is a little excessive, but it sets us up for per-type cursor zones in the next patch. xfs_btree_absolute_maxlevels exists to enable xfs_db functionality. 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.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
index e1cc9d700212..f84d36b4b6c2 100644
--- a/fs/xfs/libxfs/xfs_btree.h
+++ b/fs/xfs/libxfs/xfs_btree.h
@@ -592,4 +592,12 @@ struct xfs_btree_cur *xfs_btree_alloc_cursor(struct xfs_mount *mp,
struct xfs_trans *tp, xfs_btnum_t btnum);
unsigned int xfs_btree_maxlevels(struct xfs_mount *mp, xfs_btnum_t btnum);
+void __init xfs_btree_absolute_minrecs(unsigned int *minrecs,
+ unsigned int bc_flags, unsigned int leaf_recbytes,
+ unsigned int node_recbytes);
+int __init xfs_btree_create_cursor_cache(xfs_btnum_t btnum, const char *name,
+ unsigned int maxlevels);
+int __init xfs_btree_alias_cursor_cache(xfs_btnum_t btnum, xfs_btnum_t src);
+unsigned int xfs_btree_absolute_maxlevels(xfs_btnum_t btnum);
+
#endif /* __XFS_BTREE_H__ */