]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: move extent locking outside of btrfs_truncate_inode_items
authorJosef Bacik <josef@toxicpanda.com>
Fri, 3 Dec 2021 22:18:05 +0000 (17:18 -0500)
committerDavid Sterba <dsterba@suse.com>
Fri, 7 Jan 2022 13:18:24 +0000 (14:18 +0100)
commitf2d2684d7317321230f2023442dcb1a41e3012ea
tree40f7c40c64763d57f4e8a274f49467d8d740a31c
parent2b4bb12dcc6c5f4dfe326dbd303dce946d395b3c
btrfs: move extent locking outside of btrfs_truncate_inode_items

Currently we are locking the extent and dropping the extent cache for
any inodes we truncate, unless they're in the tree log.  We call this
helper from:

- truncate
- evict
- tree log
- free space cache truncation

For evict we've already dropped all of the extent cache for this inode
once we've gotten here, and we're the only one accessing this inode, so
this step is unnecessary.

For the tree log code we already skip this part.

Pull this work into the truncate path and the free space cache
truncation path.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/free-space-cache.c
fs/btrfs/inode-item.c
fs/btrfs/inode.c