1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-24 17:57:48 +03:00

refactor: add defines for raid segtypes

This will be reused later on in upcoming code...
This commit is contained in:
Peter Rajnoha 2014-08-15 13:03:21 +02:00
parent bf78e55ef3
commit ec0d2f7aa4
2 changed files with 25 additions and 12 deletions

View File

@ -150,6 +150,19 @@ struct segment_type *init_unknown_segtype(struct cmd_context *cmd,
int init_raid_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
#endif
#define SEG_TYPE_NAME_RAID1 "raid1"
#define SEG_TYPE_NAME_RAID10 "raid10"
#define SEG_TYPE_NAME_RAID4 "raid4"
#define SEG_TYPE_NAME_RAID5 "raid5"
#define SEG_TYPE_NAME_RAID5_LA "raid5_la"
#define SEG_TYPE_NAME_RAID5_LS "raid5_ls"
#define SEG_TYPE_NAME_RAID5_RA "raid5_ra"
#define SEG_TYPE_NAME_RAID5_RS "raid5_rs"
#define SEG_TYPE_NAME_RAID6 "raid6"
#define SEG_TYPE_NAME_RAID6_NC "raid6_nc"
#define SEG_TYPE_NAME_RAID6_NR "raid6_nr"
#define SEG_TYPE_NAME_RAID6_ZR "raid6_zr"
#ifdef REPLICATOR_INTERNAL
int init_replicator_segtype(struct cmd_context *cmd, struct segtype_library *seglib);
#endif

View File

@ -443,18 +443,18 @@ static const struct raid_type {
unsigned parity;
int extra_flags;
} _raid_types[] = {
{ "raid1", 0, SEG_AREAS_MIRRORED },
{ "raid10", 0, SEG_AREAS_MIRRORED },
{ "raid4", 1 },
{ "raid5", 1 },
{ "raid5_la", 1 },
{ "raid5_ls", 1 },
{ "raid5_ra", 1 },
{ "raid5_rs", 1 },
{ "raid6", 2 },
{ "raid6_nc", 2 },
{ "raid6_nr", 2 },
{ "raid6_zr", 2 }
{ SEG_TYPE_NAME_RAID1, 0, SEG_AREAS_MIRRORED },
{ SEG_TYPE_NAME_RAID10, 0, SEG_AREAS_MIRRORED },
{ SEG_TYPE_NAME_RAID4, 1 },
{ SEG_TYPE_NAME_RAID5, 1 },
{ SEG_TYPE_NAME_RAID5_LA, 1 },
{ SEG_TYPE_NAME_RAID5_LS, 1 },
{ SEG_TYPE_NAME_RAID5_RA, 1 },
{ SEG_TYPE_NAME_RAID5_RS, 1 },
{ SEG_TYPE_NAME_RAID6, 2 },
{ SEG_TYPE_NAME_RAID6_NC, 2 },
{ SEG_TYPE_NAME_RAID6_NR, 2 },
{ SEG_TYPE_NAME_RAID6_ZR, 2 }
};
static struct segment_type *_init_raid_segtype(struct cmd_context *cmd,