btrfs-progs: use btrfs_bg_type_to_nparity get_raid56_space_info

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2021-10-07 00:02:41 +02:00
parent f759e9bbad
commit 754436f1ea
1 changed files with 1 additions and 2 deletions

View File

@ -355,13 +355,12 @@ static void get_raid56_space_info(struct btrfs_ioctl_space_args *sargs,
u64 size; u64 size;
double l_data_ratio, l_metadata_ratio, l_system_ratio, rt; double l_data_ratio, l_metadata_ratio, l_system_ratio, rt;
parities_count = btrfs_bg_type_to_nparity(info_ptr->type);
if (info_ptr->type & BTRFS_BLOCK_GROUP_RAID5) { if (info_ptr->type & BTRFS_BLOCK_GROUP_RAID5) {
parities_count = 1;
l_data_ratio = l_data_ratio_r5; l_data_ratio = l_data_ratio_r5;
l_metadata_ratio = l_metadata_ratio_r5; l_metadata_ratio = l_metadata_ratio_r5;
l_system_ratio = l_system_ratio_r5; l_system_ratio = l_system_ratio_r5;
} else if (info_ptr->type & BTRFS_BLOCK_GROUP_RAID6) { } else if (info_ptr->type & BTRFS_BLOCK_GROUP_RAID6) {
parities_count = 2;
l_data_ratio = l_data_ratio_r6; l_data_ratio = l_data_ratio_r6;
l_metadata_ratio = l_metadata_ratio_r6; l_metadata_ratio = l_metadata_ratio_r6;
l_system_ratio = l_system_ratio_r6; l_system_ratio = l_system_ratio_r6;