]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: only call inode_sub_bytes in truncate paths that care
authorJosef Bacik <josef@toxicpanda.com>
Fri, 3 Dec 2021 22:18:11 +0000 (17:18 -0500)
committerDavid Sterba <dsterba@suse.com>
Fri, 7 Jan 2022 13:18:24 +0000 (14:18 +0100)
commit49bcedc4dedfc5d9415027144488a61a95036c73
treee97daadf86d3bfc35957fa077c580470f6ebbce5
parent9572eac64ac1ef948c69115a7c1bd3ef8774df95
btrfs: only call inode_sub_bytes in truncate paths that care

We currently have a bunch of awkward checks to make sure we only update
the inode i_bytes if we're truncating the real inode.  Instead keep
track of the number of bytes we need to sub in the
btrfs_truncate_control, and then do the appropriate adjustment in the
truncate paths that care.

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-item.h
fs/btrfs/inode.c