From 4047e4dfb16175daec348bf44032c02181bd4c70 Mon Sep 17 00:00:00 2001 From: Jonathan Brassow Date: Fri, 24 Aug 2012 15:34:19 -0500 Subject: RAID: Add support for RAID10 This patch adds support for RAID10. It is not the default at this stage. The user needs to specify '--type raid10' if they would like RAID10 instead of stacked mirror over stripe. --- lib/raid/raid.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/raid/raid.c') diff --git a/lib/raid/raid.c b/lib/raid/raid.c index 097d36f4..78fe074e 100644 --- a/lib/raid/raid.c +++ b/lib/raid/raid.c @@ -379,6 +379,20 @@ static struct segment_type *_init_raid1_segtype(struct cmd_context *cmd) return segtype; } +static struct segment_type *_init_raid10_segtype(struct cmd_context *cmd) +{ + struct segment_type *segtype; + + segtype = _init_raid_segtype(cmd, "raid10"); + if (!segtype) + return NULL; + + segtype->flags |= SEG_AREAS_MIRRORED; + segtype->parity_devs = 0; + + return segtype; +} + static struct segment_type *_init_raid4_segtype(struct cmd_context *cmd) { return _init_raid_segtype(cmd, "raid4"); @@ -441,6 +455,7 @@ int init_multiple_segtypes(struct cmd_context *cmd, struct segtype_library *segl unsigned i = 0; struct segment_type *(*raid_segtype_fn[])(struct cmd_context *) = { _init_raid1_segtype, + _init_raid10_segtype, _init_raid4_segtype, _init_raid5_segtype, _init_raid5_la_segtype, -- cgit