]> git.itanic.dy.fi Git - linux-stable/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Sep 2020 17:04:29 +0000 (19:04 +0200)
commit88814d0bc8cdbf651e03a62de1d4530d337b8952
treebb46e26e81ceeefbfe33f232fafa18992c8b6ead
parent2ca6e25f06070fb5a8f8429f4e7a53ff538d1673
btrfs: Remove extraneous extent_buffer_get from tree_mod_log_rewind

[ Upstream commit 24cee18a1c1d7c731ea5987e0c99daea22ae7f4a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/ctree.c