]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: clean up xfs_btree_{calc_size,compute_maxlevels}
authorDarrick J. Wong <djwong@kernel.org>
Wed, 13 Oct 2021 18:10:45 +0000 (11:10 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 19 Oct 2021 18:45:16 +0000 (11:45 -0700)
commiteb179153fbbcea14e7b5638a8406270192bbbb68
tree8d88b061e4e4d5d3a0c88510cad7ec3b12b76ee0
parente6ae2ba5404850c664b75cd545b8eef9855778f7
xfs: clean up xfs_btree_{calc_size,compute_maxlevels}

During review of the next patch, Dave remarked that he found these two
btree geometry calculation functions lacking in documentation and that
they performed more work than was really necessary.

These functions take the same parameters and have nearly the same logic;
the only real difference is in the return values.  Reword the function
comment to make it clearer what each function does, and move them to be
adjacent to reinforce their relation.

Clean up both of them to stop opencoding the howmany functions, stop
using the uint typedefs, and make them both support computations for
more than 2^32 leaf records, since we're going to need all of the above
for files with large data forks and large rmap btrees.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/libxfs/xfs_btree.c
fs/xfs/libxfs/xfs_btree.h