• Filipe Manana's avatar
    btrfs: get the next extent map during fiemap/lseek more efficiently · d47704bd
    Filipe Manana authored
    At find_delalloc_subrange(), when we need to get the next extent map, we
    do a full search on the extent map tree (a red black tree). This is fine
    but it's a lot more efficient to simply use rb_next(), which typically
    requires iterating over less nodes of the tree and never needs to compare
    the ranges of nodes with the one we are looking for.
    
    So add a public helper to extent_map.{h,c} to get the extent map that
    immediately follows another extent map, using rb_next(), and use that
    helper at find_delalloc_subrange().
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    d47704bd
extent_map.h 3.3 KB