]> 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)
commitac36953bc1eb09d843099c74b10ce4d342d0c7c4
treee97daadf86d3bfc35957fa077c580470f6ebbce5
parent72d2326a57ba1558d8b42b07ff3a5fda12544863
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