Skip to content

Commit f77da2b

Browse files
morbidrsakdave
authored andcommitted
btrfs-progs: zoned support DUP on metadata block groups
Support using BTRFS_BLOCK_GROUP_DUP on metadata (and system) block groups. Signed-off-by: Johannes Thumshirn <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 88895a9 commit f77da2b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

kernel-shared/zoned.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,14 +808,20 @@ static int calculate_alloc_pointer(struct btrfs_fs_info *fs_info,
808808
return ret;
809809
}
810810

811-
bool zoned_profile_supported(u64 flags)
811+
bool zoned_profile_supported(u64 map_type)
812812
{
813-
flags &= BTRFS_BLOCK_GROUP_PROFILE_MASK;
813+
bool data = (map_type & BTRFS_BLOCK_GROUP_DATA);
814+
u64 flags = (map_type & BTRFS_BLOCK_GROUP_PROFILE_MASK);
814815

815816
/* SINGLE */
816817
if (flags == 0)
817818
return true;
818-
/* non-single profiles are not supported yet */
819+
820+
/* We can support DUP on metadata */
821+
if (!data && (flags & BTRFS_BLOCK_GROUP_DUP))
822+
return true;
823+
824+
/* All other profiles are not supported yet */
819825
return false;
820826
}
821827

0 commit comments

Comments
 (0)