]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Remove unnecessary tree locking code in qgroup_rescan_leaf
authorNikolay Borisov <nborisov@suse.com>
Wed, 15 Aug 2018 15:26:56 +0000 (18:26 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:31 +0000 (14:51 +0100)
commit43974088ad456b8550384f95f409dadc45db777d
treede42b5fe8f4d523bc02bca4cff0d33470704d3cc
parent05d68ee21b77adbfcd426f818581fd15e5224437
btrfs: Remove unnecessary tree locking code in qgroup_rescan_leaf

In qgroup_rescan_leaf a copy is made of the target leaf by calling
btrfs_clone_extent_buffer. The latter allocates a new buffer and
attaches a new set of pages and copies the content of the source buffer.
The new scratch buffer is only used to iterate it's items, it's not
published anywhere and cannot be accessed by a third party.

Hence, it's not necessary to perform any locking on it whatsoever.
Furthermore, remove the extra extent_buffer_get call since the new
buffer is always allocated with a reference count of 1 which is
sufficient here.  No functional changes.

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/qgroup.c