]> sourceware.org Git - lvm2.git/commitdiff
refactor: add defines for raid segtypes
authorPeter Rajnoha <prajnoha@redhat.com>
Fri, 15 Aug 2014 11:03:21 +0000 (13:03 +0200)
committerPeter Rajnoha <prajnoha@redhat.com>
Fri, 15 Aug 2014 11:28:43 +0000 (13:28 +0200)
This will be reused later on in upcoming code...

lib/metadata/segtype.h
lib/raid/raid.c

index 891c378789006b7127cb1f79a584ee336325a3b5..080cf4ea6ebff517735b749800012f5f64e56fe2 100644 (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
index c3f5c3f05d976ab5a7a8577804777d2770295ab5..5aad447a15db416bc725e926d8c01dd56551952e 100644 (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,
This page took 0.040059 seconds and 5 git commands to generate.