summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode-item.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-12-03 17:18:12 -0500
committerDavid Sterba <dsterba@suse.com>2022-01-07 14:18:24 +0100
commit5caa490ed8f07488e47378999bd4ad451bf8858b (patch)
treec65ac19b2c7fafac0d671813c95aa67cb4ad06ee /fs/btrfs/inode-item.h
parent462b728ea83fa85f1c0d2b79efb6187745444ce5 (diff)
downloadlinux-5caa490ed8f07488e47378999bd4ad451bf8858b.tar.bz2
btrfs: control extent reference updates with a control flag for truncate
We've had weird bugs in the past where we forgot to adjust the truncate path to deal with the fact that we can be called by the tree log path. Instead of checking if our root is a LOG_ROOT use a flag on the btrfs_truncate_control to indicate that we don't want to do extent reference updates during this truncate. 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>
Diffstat (limited to 'fs/btrfs/inode-item.h')
-rw-r--r--fs/btrfs/inode-item.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/inode-item.h b/fs/btrfs/inode-item.h
index 7b5b455262cb..1f31bb407f4a 100644
--- a/fs/btrfs/inode-item.h
+++ b/fs/btrfs/inode-item.h
@@ -37,6 +37,12 @@ struct btrfs_truncate_control {
* removed only if their offset >= new_size.
*/
u32 min_type;
+
+ /*
+ * IN: true if we don't want to do extent reference updates for any file
+ * extents we drop.
+ */
+ bool skip_ref_updates;
};
int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,