Home
last modified time | relevance | path

Searched hist:"9 aa06c76" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/fs/btrfs/
H A Ddelalloc-space.c9aa06c76 Tue Mar 21 06:13:46 CDT 2023 Filipe Manana <fdmanana@suse.com> btrfs: count extents before taking inode's spinlock when reserving metadata

When reserving metadata space for delalloc (and direct IO too), at
btrfs_delalloc_reserve_metadata(), there's no need to count the number of
extents while holding the inode's spinlock, since that does not require
access to any field of the inode.

This section of code can be called concurrently, when we have direct IO
writes against different file ranges that don't increase the inode's
i_size, so it's beneficial to shorten the critical section by counting
the number of extents before taking the inode's spinlock.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>