• Darrick J. Wong's avatar
    xfs: refactor btree maxlevels computation · 19b54ee6
    Darrick J. Wong authored
    Create a common function to calculate the maximum height of a per-AG
    btree.  This will eventually be used by the rmapbt and refcountbt
    code to calculate appropriate maxlevels values for each.  This is
    important because the verifiers and the transaction block
    reservations depend on accurate estimates of how many blocks are
    needed to satisfy a btree split.
    
    We were mistakenly using the max bnobt height for all the btrees,
    which creates a dangerous situation since the larger records and
    keys in an rmapbt make it very possible that the rmapbt will be
    taller than the bnobt and so we can run out of transaction block
    reservation.
    Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
    Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
    
    19b54ee6
xfs_btree.h 14.8 KB