btrfs-progs: a more generic uuid tree rebuild ability
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | btrfs-progs: move uuid-tree definitions to kernel-shared/uuid-tree.hcommon/ kernel-shared/ kernel-shared/ +2 more | +36 | 0 replies | |
| 2/3 | btrfs-progs: cross-port btrfs_uuid_tree_add() from kernelkernel-shared/ kernel-shared/ mkfs/ | +121 | 0 replies | |
| 3/3 | btrfs-progs: introduce btrfs_rebuild_uuid_tree() for mkfs and btrfs-convertcommon/ common/ convert/ +1 more | +274 | 5 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] btrfs-progs: a more generic uuid tree rebuild ability
Inspired by Mark's previous attempt to add multi-subvolume mkfs support, one of the problem he hits is the uuid tree generation.
Currently the uuid tree is only generated for mkfs, but that's hard-coded for FS_TREE. Furthermore btrfs-convert doesn't really generate a UUID tree at all.
Thus this patchset introduces a more generic uuid tree rebuild, without the need to touch the existing subvolume creation code.
This is done by:
- Create a new uuid tree if there is not one
- Empty the existing 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
This can handle all the situations I can think of, include the future multi-subvolume mkfs support.
The first two patches are just cleanup and preparation, the main dish is the last patch.
Qu Wenruo (3):
btrfs-progs: move uuid-tree definitions to kernel-shared/uuid-tree.h
btrfs-progs: cross-port btrfs_uuid_tree_add() from kernel
btrfs-progs: introduce btrfs_rebuild_uuid_tree() for mkfs and
btrfs-convert
common/root-tree-utils.c | 265 ++++++++++++++++++++++++++++++++++++++ common/root-tree-utils.h | 1 + common/send-utils.c | 1 + convert/main.c | 5 + kernel-shared/ctree.h | 11 -- kernel-shared/uuid-tree.c | 120 +++++++++++++++++ kernel-shared/uuid-tree.h | 35 +++++ mkfs/main.c | 94 +------------- 8 files changed, 431 insertions(+), 101 deletions(-) create mode 100644 kernel-shared/uuid-tree.h
--
2.45.2