btrfs-progs: don't pretend RAID56 has a different stripe length

Since it's addition in 2009 BTRFS RAID5/6 uses a constant stripe length
and we're lacking the meta-data to define a per stripe length, so it's
unlikely to change in the near future for RAID5/6.

So let's not pretend something we don't do and remove the RAID5/6 stripe
length special casing.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Johannes Thumshirn 2020-06-10 21:32:57 +09:00 committed by David Sterba
parent 2ef15943a0
commit b9444efb66

View File

@ -900,13 +900,6 @@ static u64 chunk_bytes_by_type(u64 type, u64 calc_size,
return calc_size * ctl->num_stripes;
}
static u32 find_raid56_stripe_len(u32 data_devices, u32 dev_stripe_target)
{
/* TODO, add a way to store the preferred stripe size */
return BTRFS_STRIPE_LEN;
}
/*
* btrfs_device_avail_bytes - count bytes available for alloc_chunk
*
@ -1092,13 +1085,9 @@ static void init_alloc_chunk_ctl(struct btrfs_fs_info *info,
break;
case BTRFS_RAID_RAID5:
ctl->num_stripes = min(ctl->max_stripes, ctl->total_devs);
ctl->stripe_len = find_raid56_stripe_len(ctl->num_stripes - 1,
btrfs_super_stripesize(info->super_copy));
break;
case BTRFS_RAID_RAID6:
ctl->num_stripes = min(ctl->max_stripes, ctl->total_devs);
ctl->stripe_len = find_raid56_stripe_len(ctl->num_stripes - 2,
btrfs_super_stripesize(info->super_copy));
break;
default:
break;