summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode-item.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-12-03 17:18:09 -0500
committerDavid Sterba <dsterba@suse.com>2022-01-07 14:18:24 +0100
commitd9ac19c3806434af2a92b4008dbf39c2a67c60cf (patch)
tree19a889e14a1f4ab9c60901410797639a4392a0af /fs/btrfs/inode-item.h
parent7097a941bf75ed1f632342937984a24f0b1d76a4 (diff)
downloadlinux-d9ac19c3806434af2a92b4008dbf39c2a67c60cf.tar.bz2
btrfs: add truncate control struct
I'm going to be adding more arguments and counters to btrfs_truncate_inode_items, so add a control struct to handle all of the extra arguments to make it easier to follow. 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.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/fs/btrfs/inode-item.h b/fs/btrfs/inode-item.h
index 4464d7026180..beefba1f26bc 100644
--- a/fs/btrfs/inode-item.h
+++ b/fs/btrfs/inode-item.h
@@ -19,10 +19,24 @@ struct extent_buffer;
*/
#define BTRFS_NEED_TRUNCATE_BLOCK 1
+struct btrfs_truncate_control {
+ /* IN: the size we're truncating to. */
+ u64 new_size;
+
+ /* OUT: the number of extents truncated. */
+ u64 extents_found;
+
+ /*
+ * IN: minimum key type to remove. All key types with this type are
+ * removed only if their offset >= new_size.
+ */
+ u32 min_type;
+};
+
int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
- struct btrfs_inode *inode, u64 new_size,
- u32 min_type, u64 *extents_found);
+ struct btrfs_inode *inode,
+ struct btrfs_truncate_control *control);
int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
const char *name, int name_len,