Commit 8c7eeb65 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Remove extra reference count bumps in btrfs_compare_trees

When the 2 comparison trees roots are initialised they are private to
the function and already have reference counts of 1 each. There is no
need to further increment the reference count since the cloned buffers
are already accessed via struct btrfs_path. Eventually the 2 paths used
for comparison are going to be released, effectively disposing of the
cloned buffers.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 24cee18a
...@@ -5388,7 +5388,6 @@ int btrfs_compare_trees(struct btrfs_root *left_root, ...@@ -5388,7 +5388,6 @@ int btrfs_compare_trees(struct btrfs_root *left_root,
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
} }
extent_buffer_get(left_path->nodes[left_level]);
right_level = btrfs_header_level(right_root->commit_root); right_level = btrfs_header_level(right_root->commit_root);
right_root_level = right_level; right_root_level = right_level;
...@@ -5399,7 +5398,6 @@ int btrfs_compare_trees(struct btrfs_root *left_root, ...@@ -5399,7 +5398,6 @@ int btrfs_compare_trees(struct btrfs_root *left_root,
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
} }
extent_buffer_get(right_path->nodes[right_level]);
up_read(&fs_info->commit_root_sem); up_read(&fs_info->commit_root_sem);
if (left_level == 0) if (left_level == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment