]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: add support for multiple global roots
authorJosef Bacik <josef@toxicpanda.com>
Wed, 15 Dec 2021 20:40:08 +0000 (15:40 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 14 Mar 2022 12:13:49 +0000 (13:13 +0100)
commit87a73276c89555697b1a1fd83824c9ecf42a99ec
tree424a7ed9cc73b2c7ecfe1973590b442ffcee6abf
parenta962add27064fa7dbb7ec4d08e23620ac47736dd
btrfs: add support for multiple global roots

With extent tree v2 you will be able to create multiple csum, extent,
and free space trees.  They will be used based on the block group, which
will now use the block_group_item->chunk_objectid to point to the set of
global roots that it will use.  When allocating new block groups we'll
simply mod the gigabyte offset of the block group against the number of
global roots we have and that will be the block groups global id.

>From there we can take the bytenr that we're modifying in the respective
tree, look up the block group and get that block groups corresponding
global root id.  From there we can get to the appropriate global root
for that bytenr.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c
fs/btrfs/block-group.h
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/free-space-tree.c
fs/btrfs/transaction.c
fs/btrfs/tree-checker.c