diff options
author | Josef Bacik <josef@toxicpanda.com> | 2020-01-17 15:02:21 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-03-23 17:01:24 +0100 |
commit | 41a2ee75aab0290a5899677437736ec715dcd1b6 (patch) | |
tree | 68a747669fafc6d2a4f0da8760de78a004ba4f55 /fs/btrfs/btrfs_inode.h | |
parent | btrfs: use btrfs_ordered_update_i_size in clone_finish_inode_update (diff) | |
download | linux-41a2ee75aab0290a5899677437736ec715dcd1b6.tar.xz linux-41a2ee75aab0290a5899677437736ec715dcd1b6.zip |
btrfs: introduce per-inode file extent tree
In order to keep track of where we have file extents on disk, and thus
where it is safe to adjust the i_size to, we need to have a tree in
place to keep track of the contiguous areas we have file extents for.
Add helpers to use this tree, as it's not required for NO_HOLES file
systems. We will use this by setting DIRTY for areas we know we have
file extent item's set, and clearing it when we remove file extent items
for truncation.
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/btrfs_inode.h')
-rw-r--r-- | fs/btrfs/btrfs_inode.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 4e12a477d32e..27a1fefce508 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -60,6 +60,12 @@ struct btrfs_inode { */ struct extent_io_tree io_failure_tree; + /* + * Keep track of where the inode has extent items mapped in order to + * make sure the i_size adjustments are accurate + */ + struct extent_io_tree file_extent_tree; + /* held while logging the inode in tree-log.c */ struct mutex log_mutex; |