]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Remove extraneous extent_buffer_get from tree_mod_log_rewind
authorNikolay Borisov <nborisov@suse.com>
Wed, 15 Aug 2018 15:26:54 +0000 (18:26 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:30 +0000 (14:51 +0100)
commitc93ce3040752059817c5e816c80708c22dfa0653
tree352a7c115c8b17612c5591aa0333797987d5f97b
parentf59586a84908bcdd2e9524c086dac275acfb621f
btrfs: Remove extraneous extent_buffer_get from tree_mod_log_rewind

When a rewound buffer is created it already has a ref count of 1 and the
dummy flag set. Then another ref is taken bumping the count to 2.
Finally when this buffer is released from btrfs_release_path the extra
reference is decremented by the special handling code in
free_extent_buffer.

However, this special code is in fact redundant sinca ref count of 1 is
still correct since the buffer is only accessed via btrfs_path struct.
This paves the way forward of removing the special handling in
free_extent_buffer.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c