• Nikolay Borisov's avatar
    btrfs: Adjust loop in free_extent_buffer · 46cc775e
    Nikolay Borisov authored
    The loop construct in free_extent_buffer was added in
    242e18c7 ("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: default avatarNikolay Borisov <nborisov@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    46cc775e
inode-tests.c 31.8 KB