All striping RAID Levels use the same method to set the number of RAID stripes, so consolidate it. Signed-off-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx> --- volumes.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/volumes.c b/volumes.c index ec31acd57aa7..7c57d6cb376e 100644 --- a/volumes.c +++ b/volumes.c @@ -1077,17 +1077,12 @@ static void init_alloc_chunk_ctl(struct btrfs_fs_info *info, ctl->num_stripes = min(ctl->min_stripes, ctl->total_devs); break; case BTRFS_RAID_RAID0: - ctl->num_stripes = min(ctl->max_stripes, ctl->total_devs); - break; case BTRFS_RAID_RAID10: - ctl->num_stripes = min(ctl->max_stripes, ctl->total_devs); - ctl->num_stripes &= ~(u32)1; - break; case BTRFS_RAID_RAID5: - ctl->num_stripes = min(ctl->max_stripes, ctl->total_devs); - break; case BTRFS_RAID_RAID6: ctl->num_stripes = min(ctl->max_stripes, ctl->total_devs); + if (type == BTRFS_RAID_RAID10) + ctl->num_stripes &= ~(u32)1; break; default: break; -- 2.26.2
