Skip to content

Commit f97bebc

Browse files
morbidrsakdave
authored andcommitted
btrfs-progs: zoned: create a data block-group for relocation
Create a second data block-group to be used for relocation, in case a zoned filesystem in created. This second data block-group will then be picked up by the kernel as the default data relocation block-group on mount. This ensures we always have a target to relocate good data to when we need to do garbage collection. Signed-off-by: Johannes Thumshirn <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 013545e commit f97bebc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

mkfs/main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,6 +2044,15 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
20442044
goto error;
20452045
}
20462046

2047+
if (features.incompat_flags & BTRFS_FEATURE_INCOMPAT_ZONED) {
2048+
ret = create_data_block_groups(trans, root, mixed, &allocation);
2049+
if (ret) {
2050+
errno = -ret;
2051+
error("failed to create data relocation block groups: %m");
2052+
goto error;
2053+
}
2054+
}
2055+
20472056
if (features.incompat_flags & BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2) {
20482057
ret = create_global_roots(trans, nr_global_roots);
20492058
if (ret) {

0 commit comments

Comments
 (0)