Re: [PATCH 16/17] xfs: compute absolute maximum nlevels for each btree type
From: Dave Chinner <david@fromorbit.com>
Date: 2021-10-14 23:08:46
On Thu, Oct 14, 2021 at 01:18:22PM -0700, Darrick J. Wong wrote:
From: Darrick J. Wong <djwong@kernel.org> Add code for all five btree types so that we can compute the absolute maximum possible btree height for each btree type. This is a setup for the next patch, which makes every btree type have its own cursor cache. The functions are exported so that we can have xfs_db report the absolute maximum btree heights for each btree type, rather than making everyone run their own ad-hoc computations. Signed-off-by: Darrick J. Wong <djwong@kernel.org> --- fs/xfs/libxfs/xfs_alloc.c | 1 + fs/xfs/libxfs/xfs_alloc_btree.c | 33 ++++++++++++++++++- fs/xfs/libxfs/xfs_alloc_btree.h | 2 + fs/xfs/libxfs/xfs_bmap.c | 1 + fs/xfs/libxfs/xfs_bmap_btree.c | 31 +++++++++++++++++- fs/xfs/libxfs/xfs_bmap_btree.h | 2 + fs/xfs/libxfs/xfs_fs.h | 2 + fs/xfs/libxfs/xfs_ialloc.c | 1 + fs/xfs/libxfs/xfs_ialloc_btree.c | 61 ++++++++++++++++++++++++++++++++++-- fs/xfs/libxfs/xfs_ialloc_btree.h | 2 + fs/xfs/libxfs/xfs_refcount_btree.c | 45 ++++++++++++++++++++++----- fs/xfs/libxfs/xfs_refcount_btree.h | 2 + fs/xfs/libxfs/xfs_rmap_btree.c | 43 +++++++++++++++++++++++-- fs/xfs/libxfs/xfs_rmap_btree.h | 2 + 14 files changed, 207 insertions(+), 21 deletions(-)
It's a little more verbose than the previous version, but the clear explanations of how we are calculating the maximum levels is a big improvement. Nice! Reviewed-by: Dave Chinner <redacted> -- Dave Chinner david@fromorbit.com