• Filipe Manana's avatar
    btrfs: add helper to replace extent map range with a new extent map · a1ba4c08
    Filipe Manana authored
    We have several places that need to drop all the extent maps in a given
    file range and then add a new extent map for that range. Currently they
    call btrfs_drop_extent_map_range() to delete all extent maps in the range
    and then keep trying to add the new extent map in a loop that keeps
    retrying while the insertion of the new extent map fails with -EEXIST.
    
    So instead of repeating this logic, add a helper to extent_map.c that
    does these steps and name it btrfs_replace_extent_map_range(). Also add
    a comment about why the retry loop is necessary.
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    a1ba4c08
file.c 114 KB