Change "parity" to "layout", use new flag to mdadm
authorJamie Cameron <jcameron@webmin.com>
Tue, 25 Aug 2009 21:45:17 +0000 (14:45 -0700)
committerJamie Cameron <jcameron@webmin.com>
Tue, 25 Aug 2009 21:45:17 +0000 (14:45 -0700)
raid/create_raid.cgi
raid/lang/en
raid/raid-lib.pl
raid/raid_form.cgi
raid/view_raid.cgi

index 2084ed0..a56fe32 100755 (executable)
@@ -18,9 +18,9 @@ push(@members, { 'name' => 'persistent-superblock',
                 'value' => $in{'super'} } );
 push(@members, { 'name' => 'chunk-size',
                 'value' => $in{'chunk'} } );
-if ($in{'parity'}) {
+if ($in{'layout'}) {
        push(@members, { 'name' => 'parity-algorithm',
-                        'value' => $in{'parity'} } );
+                        'value' => $in{'layout'} } );
        }
 
 # Add RAID disks
index dd0f806..8c4b981 100644 (file)
@@ -40,7 +40,7 @@ create_missing=Include currently missing disk?
 create_pauto=Automatic
 create_nodisks=No free partitions are available for RAID.
 create_super=Persistent superblock?
-create_parity=Parity algorithm
+create_parity=Layout
 create_chunk=Chunk size
 create_force=Force initialisation of RAID?
 create_assume=Skip initialization of devices?
@@ -70,7 +70,7 @@ view_lvm=Used in LVM VG $1
 view_active=Active but not mounted
 view_inactive=Inactive and not mounted
 view_super=Persistent superblock?
-view_parity=Parity algorithm
+view_parity=Layout
 view_chunk=Chunk size
 view_stop=Deactivate
 view_stopdesc=Click this button to shut down the RAID device, so that it can no longer be accessed.
index 05da8bb..d58fd3e 100755 (executable)
@@ -324,7 +324,7 @@ else {
        $lvl =~ s/^raid//;
        local $chunk = &find_value("chunk-size", $_[0]->{'members'});
        local $mode = &find_value("persistent-superblock", $_[0]->{'members'}) ? "create" : "build";
-       local $parity = &find_value("parity-algorithm", $_[0]->{'members'});
+       local $layout = &find_value("parity-algorithm", $_[0]->{'members'});
        local ($d, @devices, @spares, @parities);
        foreach $d (&find("device", $_[0]->{'members'})) {
                if (&find("raid-disk", $d->{'members'})) {
@@ -341,7 +341,7 @@ else {
        if ($_[2]) {
                push(@devices, "missing");
                }
-       $cmd .= " --parity $parity" if ($parity);
+       $cmd .= " --layout $layout" if ($layout);
        $cmd .= " --raid-devices ".scalar(@devices);
        $cmd .= " --spare-devices ".scalar(@spares) if (@spares);
        $cmd .= " --force" if ($_[1]);
index 4c84213..34d117f 100755 (executable)
@@ -54,14 +54,23 @@ $super = &find_value('persistent-superblock', $raid->{'members'});
 print &ui_table_row($text{'create_super'},
        &ui_yesno_radio("super", $super ? 1 : 0));
 
-# Parity algorithm
-if ($lvl >= 5) {
-       $parity = &find_value('parity-algorithm', $raid->{'members'});
+# Layout
+if ($lvl == 5 || $lvl == 6) {
+       $layout = &find_value('parity-algorithm', $raid->{'members'});
        print &ui_table_row($text{'create_parity'},
-               &ui_select("parity", $parity,
+               &ui_select("layout", $layout,
                        [ [ '', $text{'default'} ],
                          'left-asymmetric', 'right-asymmetric',
-                         'left-symmetric', 'right-symmetric' ]));
+                         'left-symmetric', 'right-symmetric',
+                         'parity-first', 'parity-last' ]));
+       }
+
+if ($lvl == 10) {
+       $layout = &find_value('parity-algorithm', $raid->{'members'});
+       print &ui_table_row($text{'create_parity'},
+               &ui_select("layout", $layout,
+                       [ [ '', $text{'default'} ],
+                         'n2', 'o2', 'f2' ]));
        }
 
 # Chunk size
index 3e868dc..7df7f0f 100755 (executable)
@@ -50,8 +50,8 @@ print &ui_table_row($text{'view_super'},
 
 # Parity method
 if ($lvl eq '5') {
-       $parity = &find_value('parity-algorithm', $raid->{'members'});
-       print &ui_table_row($text{'view_parity'}, $parity || $text{'default'});
+       $layout = &find_value('parity-algorithm', $raid->{'members'});
+       print &ui_table_row($text{'view_parity'}, $layout || $text{'default'});
        }
 
 # Chunk size