Commit df449714 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba
Browse files

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: default avatarNikolay Borisov <>
Reviewed-by: default avatarDavid Sterba <>
Signed-off-by: default avatarDavid Sterba <>
parent 8c7eeb65
......@@ -3104,9 +3104,6 @@ static int qgroup_rescan_leaf(struct btrfs_trans_handle *trans,
goto out;
btrfs_set_lock_blocking_rw(scratch_leaf, BTRFS_READ_LOCK);
slot = path->slots[0];
......@@ -3132,10 +3129,8 @@ static int qgroup_rescan_leaf(struct btrfs_trans_handle *trans,
goto out;
if (scratch_leaf) {
if (scratch_leaf)
if (done && !ret) {
ret = 1;
Supports Markdown
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