]> sourceware.org Git - lvm2.git/commitdiff
lvconvert: separate type raid to mirror
authorDavid Teigland <teigland@redhat.com>
Mon, 8 Aug 2016 15:37:24 +0000 (10:37 -0500)
committerDavid Teigland <teigland@redhat.com>
Mon, 8 Aug 2016 15:37:24 +0000 (10:37 -0500)
By the current division of unique operations,
converting type raid to type mirror is distinct
from converting type raid to raid.

man/lvconvert.8.in
tools/lvconvert.c

index 5ddea3d6ca41a20ad9a9cc70f7294d3d9ca517a1..641e850a631d498fff0c742102c08b9505a5494b 100644 (file)
@@ -452,6 +452,12 @@ Convert RaidLV to use a different raid level.
 \[bu]
 Required options depend on the raid level.
 
+.B lvconvert \-\-type mirror
+VG/RaidLV
+.br
+\[bu]
+Convert RaidLV to type mirror.
+
 .B lvconvert \-\-type striped
 VG/RaidLV
 .br
index e7c34f7c6524a7d73ae4e65d9567a8e117f39da4..8dc9f6ddb1c22e863b3bff013d14b3a205a89835 100644 (file)
@@ -3921,6 +3921,16 @@ static int _convert_raid_raid(struct cmd_context *cmd, struct logical_volume *lv
        return _lvconvert_raid(lv, lp);
 }
 
+/*
+ * Convert a raid* LV to a mirror LV.
+ * lvconvert --type mirror LV
+ */
+static int _convert_raid_mirror(struct cmd_context *cmd, struct logical_volume *lv,
+                             struct lvconvert_params *lp)
+{
+       return _lvconvert_raid(lv, lp);
+}
+
 /*
  * Convert a raid* LV to a striped LV.
  * lvconvert --type striped LV
@@ -4282,9 +4292,12 @@ static int _convert_raid(struct cmd_context *cmd, struct logical_volume *lv,
        if (!strcmp(lp->type_str, SEG_TYPE_NAME_CACHE_POOL) || arg_is_set(cmd, cachepool_ARG))
                return _convert_raid_cache_pool(cmd, lv, lp);
 
-       if (segtype_is_raid(lp->segtype) || segtype_is_mirror(lp->segtype))
+       if (segtype_is_raid(lp->segtype))
                return _convert_raid_raid(cmd, lv, lp);
 
+       if (segtype_is_mirror(lp->segtype))
+               return _convert_raid_mirror(cmd, lv, lp);
+
        if (!strcmp(lp->type_str, SEG_TYPE_NAME_STRIPED))
                return _convert_raid_striped(cmd, lv, lp);
 
This page took 0.047699 seconds and 5 git commands to generate.