• Brian Foster's avatar
    xfs: reuse best extent tracking logic for bnobt scan · fec0afda
    Brian Foster authored
    The near mode bnobt scan searches left and right in the bnobt
    looking for the closest free extent to the allocation hint that
    satisfies minlen. Once such an extent is found, the left/right
    search terminates, we search one more time in the opposite direction
    and finish the allocation with the best overall extent.
    
    The left/right and find best searches are currently controlled via a
    combination of cursor state and local variables. Clean up this code
    and prepare for further improvements to the near mode fallback
    algorithm by reusing the allocation cursor best extent tracking
    mechanism. Update the tracking logic to deactivate bnobt cursors
    when out of allocation range and replace open-coded extent checks to
    calls to the common helper. In doing so, rename some misnamed local
    variables in the top-level near mode allocation function.
    Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
    Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    fec0afda
xfs_trace.h 110 KB