• Lukas Czerner's avatar
    ext4: try to prepend extent to the existing one · be8981be
    Lukas Czerner authored
    Currently when inserting extent in ext4_ext_insert_extent() we would
    only try to to see if we can append new extent to the found extent. If
    we can not, then we proceed with adding new extent into the extent tree,
    but then possibly merging it back again.
    
    We can avoid this situation by trying to append and prepend new extent
    to the existing ones. However since the new extent can be on either
    sides of the existing extent, we have to pick the right extent to try to
    append/prepend to.
    
    This patch adds the conditions to pick the right extent to
    append/prepend to and adds the actual prepending condition as well. This
    will also eliminate the need to use "reserved" block for possibly
    growing extent tree.
    Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
    Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
    be8981be
extents.c 131 KB