btrfs: move can_cow_file_range_inline() outside of the extent lock
authorJosef Bacik <josef@toxicpanda.com>
Wed, 3 Apr 2024 17:57:30 +0000 (13:57 -0400)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 May 2024 19:31:10 +0000 (21:31 +0200)
commitcd241a8f554c258e92a694f6aa07e90b89ddebe6
tree7a24f5f60c7e90b1d696e08e9b5191af7d1a1215
parent0ab540995ae049f1536260b0f6124483e685b593
btrfs: move can_cow_file_range_inline() outside of the extent lock

These checks aren't reliant on the extent lock.  Move this up into
cow_file_range_inline(), and then update encoded writes to call this
check before calling __cow_file_range_inline().  This will allow us to
skip the extent lock if we're not able to inline the given extent.

Reviewed-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c