btrfs: track the csum, extent, and free space trees in a rb tree
authorJosef Bacik <josef@toxicpanda.com>
Fri, 5 Nov 2021 20:45:51 +0000 (16:45 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 3 Jan 2022 14:09:50 +0000 (15:09 +0100)
commitabed4aaae4f71a7bcdbe90a65319b6e772a2689d
tree29786ead465fab93bcd5bbe5ae4cec7fd02cb8d6
parent7fcf8a0050df003776d10602c9c52b57212f3345
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>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/extent-tree.c
fs/btrfs/free-space-tree.c
fs/btrfs/tests/btrfs-tests.c
fs/btrfs/tests/free-space-tests.c
fs/btrfs/tests/free-space-tree-tests.c
fs/btrfs/tests/qgroup-tests.c