mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2024-12-01 08:04:28 +08:00
btrfs-progs: remove btrfs_raid_profile_table
For SINGLE and DUP RAID profiles we can get the num_stripes values from btrfs_raid_attr::dev:stripes. For all other RAID profiles the value is calculated anyways. As this was the last remaining member of the btrfs_raid_profile_table we can remove it as well. Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
1b12bf7b1b
commit
fba57b689a
34
volumes.c
34
volumes.c
@ -998,44 +998,12 @@ error:
|
||||
- 2 * sizeof(struct btrfs_chunk)) \
|
||||
/ sizeof(struct btrfs_stripe) + 1)
|
||||
|
||||
static const struct btrfs_raid_profile {
|
||||
int num_stripes;
|
||||
} btrfs_raid_profile_table[BTRFS_NR_RAID_TYPES] = {
|
||||
[BTRFS_RAID_RAID10] = {
|
||||
.num_stripes = 0,
|
||||
},
|
||||
[BTRFS_RAID_RAID1] = {
|
||||
.num_stripes = 0,
|
||||
},
|
||||
[BTRFS_RAID_RAID1C3] = {
|
||||
.num_stripes = 0,
|
||||
},
|
||||
[BTRFS_RAID_RAID1C4] = {
|
||||
.num_stripes = 0,
|
||||
},
|
||||
[BTRFS_RAID_DUP] = {
|
||||
.num_stripes = 2,
|
||||
},
|
||||
[BTRFS_RAID_RAID0] = {
|
||||
.num_stripes = 0,
|
||||
},
|
||||
[BTRFS_RAID_SINGLE] = {
|
||||
.num_stripes = 1,
|
||||
},
|
||||
[BTRFS_RAID_RAID5] = {
|
||||
.num_stripes = 0,
|
||||
},
|
||||
[BTRFS_RAID_RAID6] = {
|
||||
.num_stripes = 0,
|
||||
},
|
||||
};
|
||||
|
||||
static void init_alloc_chunk_ctl(struct btrfs_fs_info *info,
|
||||
struct alloc_chunk_ctl *ctl)
|
||||
{
|
||||
int type = ctl->type;
|
||||
|
||||
ctl->num_stripes = btrfs_raid_profile_table[type].num_stripes;
|
||||
ctl->num_stripes = btrfs_raid_array[type].dev_stripes;
|
||||
ctl->min_stripes = btrfs_raid_array[type].devs_min;
|
||||
ctl->sub_stripes = btrfs_raid_array[type].sub_stripes;
|
||||
ctl->stripe_len = BTRFS_STRIPE_LEN;
|
||||
|
Loading…
Reference in New Issue
Block a user