diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2012-08-24 15:34:19 -0500 |
---|---|---|
committer | Jonathan Brassow <jbrassow@redhat.com> | 2012-08-24 15:34:19 -0500 |
commit | 4047e4dfb16175daec348bf44032c02181bd4c70 (patch) | |
tree | c65d274f9d8058e77771d439652d49c7af9d4c6b /lib/raid/raid.c | |
parent | 99d1e264a87eb256debe2eaa02d9fc4e2b08c815 (diff) | |
download | lvm2-4047e4dfb16175daec348bf44032c02181bd4c70.tar.gz lvm2-4047e4dfb16175daec348bf44032c02181bd4c70.tar.xz lvm2-4047e4dfb16175daec348bf44032c02181bd4c70.zip |
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.
Diffstat (limited to 'lib/raid/raid.c')
-rw-r--r-- | lib/raid/raid.c | 15 |
1 files changed, 15 insertions, 0 deletions
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, |