forked from kdave/btrfs-progs
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
btrfs-progs: introduce btrfs_rebuild_uuid_tree() for mkfs and btrfs-c…
…onvert Currently mkfs uses its own create_uuid_tree(), but that function is only handling FS_TREE. This means for btrfs-convert, we do not generate the uuid tree, nor add the UUID of the image subvolume. This can be a problem if we're going to support multiple subvolumes during mkfs time. To address this inconvenience, this patch introduces a new helper, btrfs_rebuild_uuid_tree(), which will: - Create a new uuid tree if there is not one - Remova all the existing items from uuid tree - Iterate through all subvolumes * If the subvolume has no valid UUID, regenerate one * Add the uuid entry for the subvolume UUID * If the subvolume has received UUID, also add it to UUID tree By this, this new helper can handle all the uuid tree generation needs for: - Current mkfs Only one uuid entry for FS_TREE - Current btrfs-convert Only FS_TREE and the image subvolume - Future multi-subvolume mkfs As we do the scan for all subvolumes. - Future "btrfs rescue rebuild-uuid-tree" Signed-off-by: Qu Wenruo <wqu@suse.com>
- Loading branch information
1 parent
baed2fb
commit f00cb18
Showing
4 changed files
with
287 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters