Commit d09cb9e1 authored by David Sterba's avatar David Sterba

btrfs: use mask for all RAID1* profiles in btrfs_calc_avail_data_space

There's a sequence of hard coded values for RAID1 profiles that are
already stored in the raid_attr table that should be used instead.
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent e26b04c4
...@@ -2243,12 +2243,8 @@ static inline int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info, ...@@ -2243,12 +2243,8 @@ static inline int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info,
if (type & BTRFS_BLOCK_GROUP_RAID0) if (type & BTRFS_BLOCK_GROUP_RAID0)
num_stripes = nr_devices; num_stripes = nr_devices;
else if (type & BTRFS_BLOCK_GROUP_RAID1) else if (type & BTRFS_BLOCK_GROUP_RAID1_MASK)
num_stripes = 2; num_stripes = rattr->ncopies;
else if (type & BTRFS_BLOCK_GROUP_RAID1C3)
num_stripes = 3;
else if (type & BTRFS_BLOCK_GROUP_RAID1C4)
num_stripes = 4;
else if (type & BTRFS_BLOCK_GROUP_RAID10) else if (type & BTRFS_BLOCK_GROUP_RAID10)
num_stripes = 4; num_stripes = 4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment