summaryrefslogtreecommitdiff
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-11-05 16:45:51 -0400
committerDavid Sterba <dsterba@suse.com>2022-01-03 15:09:50 +0100
commitabed4aaae4f71a7bcdbe90a65319b6e772a2689d (patch)
tree29786ead465fab93bcd5bbe5ae4cec7fd02cb8d6 /fs/btrfs/extent-tree.c
parent7fcf8a0050df003776d10602c9c52b57212f3345 (diff)
btrfs: track the csum, extent, and free space trees in a rb tree
In the future we are going to have multiple copies of these trees. To facilitate this we need a way to lookup the different roots we are looking for. Handle this by adding a global root rb tree that is indexed on the root->root_key. Then instead of loading the roots at mount time with individually targeted keys, simply search the tree_root for anything with the specific objectid we want. This will make it straightforward to support both old style and new style file systems. 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/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index c17caa954dd5..7f08c9e8eb28 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2947,6 +2947,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
bool skinny_metadata = btrfs_fs_incompat(info, SKINNY_METADATA);
extent_root = btrfs_extent_root(info, bytenr);
+ ASSERT(extent_root);
path = btrfs_alloc_path();
if (!path)