@@ -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;
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@wdc.com> --- volumes.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)