Btrfs: remove superfluous free_extent_buffer in read_block_for_search
authorLiu Bo <bo.liu@linux.alibaba.com>
Fri, 18 May 2018 03:00:19 +0000 (11:00 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 30 May 2018 14:46:44 +0000 (16:46 +0200)
read_block_for_search() can be simplified as:

tmp = find_extent_buffer();
if (tmp)
   return;

...

free_extent_buffer();
read_tree_block();

Apparently, @tmp must be NULL at this point, free_extent_buffer() is not
needed.

Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c

index 8c68961925b1482517bfe2c96635f5ee1cc79694..820226d42d5d546128b8b40808e684ed3665125b 100644 (file)
@@ -2432,7 +2432,6 @@ read_block_for_search(struct btrfs_root *root, struct btrfs_path *p,
        btrfs_unlock_up_safe(p, level + 1);
        btrfs_set_path_blocking(p);
 
-       free_extent_buffer(tmp);
        if (p->reada != READA_NONE)
                reada_for_search(fs_info, p, level, slot, key->objectid);