Btrfs: create UUID tree if required

This tree is not created by mkfs.btrfs. Therefore when a filesystem
is mounted writable and the UUID tree does not exist, this tree is
created if required. The tree is also added to the fs_info structure
and initialized, but this commit does not yet read or write UUID tree
elements.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
Stefan Behrens
2013-08-15 17:11:19 +02:00
committed by Chris Mason
parent 8f8ae8e213
commit f7a81ea4cc
5 changed files with 65 additions and 0 deletions

View File

@@ -4361,6 +4361,9 @@ static struct btrfs_block_rsv *get_block_rsv(
if (root == root->fs_info->csum_root && trans->adding_csums)
block_rsv = trans->block_rsv;
if (root == root->fs_info->uuid_root)
block_rsv = trans->block_rsv;
if (!block_rsv)
block_rsv = root->block_rsv;