• Josef Bacik's avatar
    btrfs: don't do extra find_extent_buffer() in do_walk_down() · 58147d5a
    Josef Bacik authored
    We do find_extent_buffer(), and then if we don't find the eb in cache we
    call btrfs_find_create_tree_block(), which calls find_extent_buffer()
    first and then allocates the extent buffer.
    
    The reason we're doing this is because if we don't find the extent
    buffer in cache we set reada = 1.  However this doesn't matter, because
    lower down we only trigger reada if !btrfs_buffer_uptodate(eb), which is
    what the case would be if we didn't find the extent buffer in cache and
    had to allocate it.
    
    Clean this up to simply call btrfs_find_create_tree_block(), and then
    use the fact that we're having to read the extent buffer off of disk to
    go ahead and kick off readahead.
    Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
    Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    58147d5a
extent-tree.c 174 KB