Skip to content

Commit f96b088

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 <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 3eff852 commit f96b088

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
@@ -2039,6 +2039,15 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
20392039
goto error;
20402040
}
20412041

2042+
if (features.incompat_flags & BTRFS_FEATURE_INCOMPAT_ZONED) {
2043+
ret = create_data_block_groups(trans, root, mixed, &allocation);
2044+
if (ret) {
2045+
errno = -ret;
2046+
error("failed to create data relocation block groups: %m");
2047+
goto error;
2048+
}
2049+
}
2050+
20422051
if (features.incompat_flags & BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2) {
20432052
ret = create_global_roots(trans, nr_global_roots);
20442053
if (ret) {

0 commit comments

Comments
 (0)