diff options
author | Nikolay Borisov <nborisov@suse.com> | 2018-10-15 17:04:01 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-12-17 16:51:31 +0300 |
commit | 46cc775e29c55d6ae9f4dbb733ec066ff56d3922 (patch) | |
tree | 1ab1d81434df3ad42830b55b8a52a63ebc3d029e /fs/btrfs/tests/btrfs-tests.c | |
parent | 9cfc8ba712be5abd476532bf672389f67e41f4ff (diff) | |
download | linux-46cc775e29c55d6ae9f4dbb733ec066ff56d3922.tar.xz |
btrfs: Adjust loop in free_extent_buffer
The loop construct in free_extent_buffer was added in
242e18c7c1a8 ("Btrfs: reduce lock contention on extent buffer locks")
as means of reducing the times the eb lock is taken, the non-last ref
count is decremented and lock is released. As the special handling
of UNMAPPED extent buffers was removed now there is only one decrement
op which is happening for EXTENT_BUFFER_UNMAPPED case.
This commit modifies the loop condition so that in case of UNMAPPED
buffers the eb's lock is taken only if we are 100% sure the eb is going
to be freed by the current executor of the code. Additionally, remove
superfluous ref count ops in btrfs test.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tests/btrfs-tests.c')
-rw-r--r-- | fs/btrfs/tests/btrfs-tests.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c index 4cb8fcfd3ec4..8a59597f1883 100644 --- a/fs/btrfs/tests/btrfs-tests.c +++ b/fs/btrfs/tests/btrfs-tests.c @@ -177,8 +177,6 @@ void btrfs_free_dummy_root(struct btrfs_root *root) if (root->node) { /* One for allocate_extent_buffer */ free_extent_buffer(root->node); - /* One for get_exent_buffer */ - free_extent_buffer(root->node); } kfree(root); } |