]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: move btrfs_kill_delayed_inode_items into evict
authorJosef Bacik <josef@toxicpanda.com>
Fri, 3 Dec 2021 22:18:07 +0000 (17:18 -0500)
committerDavid Sterba <dsterba@suse.com>
Fri, 7 Jan 2022 13:18:24 +0000 (14:18 +0100)
commitfe75b52a4ae66c9fddb1e6e4f6d29f766a395351
tree0a27e85306dec0fb7a7f29ea3d9f0f3a03bbde9d
parentdd1f89f9b3c984e95bfa44ca38b186cb42cd40a0
btrfs: move btrfs_kill_delayed_inode_items into evict

We have a special case in btrfs_truncate_inode_items() to call
btrfs_kill_delayed_inode_items() if min_type == 0, which is only called
during evict.

Instead move this out into evict proper, and add some comments because I
erroneously attempted to remove this code altogether without
understanding what we were doing.

Evict is updating the inode only because we only care about making sure
the i_nlink count has hit disk.  If we had pending deletions we don't
want to process those via the delayed inode updates, we simply want to
drop all of them and reclaim the reserved metadata space.  Then from
there the btrfs_truncate_inode_items() will do the work to remove all of
the items as appropriate.

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