btrfs-progs: add on disk pointers to global tree ids

We are going to start creating multiple sets of global trees, which at
the moment are the free space tree, csum tree, and extent tree.
Generally we will assign these at block group creation time, but Dave
would like to be able to have them per-subvolume at some point, so
reserve a slot for that as well.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Josef Bacik 2021-11-05 16:40:29 -04:00 committed by David Sterba
parent ec0eaae673
commit 5e8a779f5c
1 changed files with 13 additions and 1 deletions

View File

@ -830,7 +830,13 @@ struct btrfs_root_item {
struct btrfs_timespec otime;
struct btrfs_timespec stime;
struct btrfs_timespec rtime;
__le64 reserved[8]; /* for future */
/*
* If we want to use a specific set of fst/checksum/extent roots for
* this root.
*/
__le64 global_tree_id;
__le64 reserved[7]; /* for future */
} __attribute__ ((__packed__));
/*
@ -1717,6 +1723,12 @@ BTRFS_SETGET_FUNCS(block_group_flags,
BTRFS_SETGET_STACK_FUNCS(stack_block_group_flags,
struct btrfs_block_group_item, flags, 64);
/* extent tree v2 uses chunk_objectid for the global tree id. */
BTRFS_SETGET_STACK_FUNCS(stack_block_group_global_tree_id,
struct btrfs_block_group_item, chunk_objectid, 64);
BTRFS_SETGET_FUNCS(block_group_global_tree_id, struct btrfs_block_group_item,
chunk_objectid, 64);
/* struct btrfs_free_space_info */
BTRFS_SETGET_FUNCS(free_space_extent_count, struct btrfs_free_space_info,
extent_count, 32);