diff options
author | Josef Bacik <josef@toxicpanda.com> | 2021-12-03 17:18:07 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-01-07 14:18:24 +0100 |
commit | 2adc75d61203a7d7d0178e1c5402e1f792ac4636 (patch) | |
tree | 0a27e85306dec0fb7a7f29ea3d9f0f3a03bbde9d /fs/btrfs/inode-item.c | |
parent | 275312a03c625a35c33440d3937804b17f894e4f (diff) |
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>
Diffstat (limited to 'fs/btrfs/inode-item.c')
-rw-r--r-- | fs/btrfs/inode-item.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c index 379baeccc7d6..a7c1408cada8 100644 --- a/fs/btrfs/inode-item.c +++ b/fs/btrfs/inode-item.c @@ -488,15 +488,6 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, return -ENOMEM; path->reada = READA_BACK; - /* - * This function is also used to drop the items in the log tree before - * we relog the inode, so if root != BTRFS_I(inode)->root, it means - * it is used to drop the logged items. So we shouldn't kill the delayed - * items. - */ - if (min_type == 0 && root == inode->root) - btrfs_kill_delayed_inode_items(inode); - key.objectid = ino; key.offset = (u64)-1; key.type = (u8)-1; |