• B
    xfs: refactor shift-by-merge into xfs_bmse_merge() helper · ddb19e31
    Brian Foster 提交于
    The extent shift mechanism in xfs_bmap_shift_extents() is complicated
    and handles several different, non-deterministic scenarios. These
    include extent shifts, extent merges and potential btree updates in
    either of the former scenarios.
    
    Refactor the code to be more linear and readable. The loop logic in
    xfs_bmap_shift_extents() and some initial error checking is adjusted
    slightly. The associated btree lookup and update/delete operations are
    condensed into single blocks of code. This reduces the number of
    btree-specific blocks and facilitates the separation of the merge
    operation into a new xfs_bmse_merge() and xfs_bmse_can_merge() helpers.
    
    This is a code refactor only. The behavior of extent shift and collapse
    range is not modified.
    Signed-off-by: NBrian Foster <bfoster@redhat.com>
    Reviewed-by: NDave Chinner <dchinner@redhat.com>
    Signed-off-by: NDave Chinner <david@fromorbit.com>
    ddb19e31
xfs_bmap.c 163.0 KB