Allow selection of strip size
authorJamie Cameron <jcameron@webmin.com>
Wed, 9 Feb 2011 22:50:48 +0000 (14:50 -0800)
committerJamie Cameron <jcameron@webmin.com>
Wed, 9 Feb 2011 22:50:48 +0000 (14:50 -0800)
lvm/CHANGELOG
lvm/edit_lv.cgi
lvm/lang/en
lvm/lvm-lib.pl
lvm/save_lv.cgi

index b81371d..ae59415 100644 (file)
@@ -27,3 +27,5 @@ When editing a logical volume, the size is shown in GB or TB where possible.
 Mounted ext3+, reiser, xfs and jfs logical volumes can now have their filesystem size increased, without needing an un-mount. Thanks to Caspar Smit for the suggestions and patches to implement this.
 When editing a logical volume that is already in /etc/fstab, don't allow the filesystem to format it as to be changed, to prevent a mismatch.
 When editing a physical volume, its size can be increased to match the underlying device, such as a partition that has been grown.
+---- Changes since 1.530 ----
+When creating a new striped logical volume, the strip size can now be selected.
index 4bb37eb..d754800 100755 (executable)
@@ -164,6 +164,13 @@ if (!$in{'lv'} && !$lv->{'is_snap'}) {
        print &ui_table_row($text{'lv_stripe'},
                &ui_opt_textbox("stripe", undef, 4, $text{'lv_nostripe'},
                                $text{'lv_stripes2'}), 3);
+
+       # And strip size
+       print &ui_table_row($text{'lv_stripesize'},
+               &ui_select("stripesize", undef,
+                          [ [ undef, $text{'default'} ],
+                            map { [ $_, $_." kB" ] }
+                                map { 2**$_ } (2 .. 9) ]));
        }
 elsif (!$lv->{'is_snap'}) {
        # Show current striping
index 3a1d34b..47c79da 100644 (file)
@@ -71,6 +71,7 @@ lv_stripe=Volume striping
 lv_nostripe=Disabled (always allocate from start)
 lv_stripes=Stripe across $1 physical volumes
 lv_stripes2=Physical volumes to stripe across
+lv_stripesize=Stripe size
 lv_err=Failed to save logical volume
 lv_ename=Missing or invalid volume name
 lv_esame=A logical volume with the same name already exists
index 235b3bc..d589bb2 100755 (executable)
@@ -401,7 +401,10 @@ if ($_[0]->{'is_snap'}) {
 else {
        $cmd .= " -p ".quotemeta($_[0]->{'perm'});
        $cmd .= " -C ".quotemeta($_[0]->{'alloc'});
-       $cmd .= " -i ".quotemeta($_[0]->{'stripe'}) if ($_[0]->{'stripe'});
+       $cmd .= " -i ".quotemeta($_[0]->{'stripe'})
+               if ($_[0]->{'stripe'});
+       $cmd .= " -I ".quotemeta($_[0]->{'stripesize'})
+               if ($_[0]->{'stripesize'} && $_[0]->{'stripe'});
        $cmd .= " ".quotemeta($_[0]->{'vg'});
        }
 $cmd .= $suffix;
index 8f9a16e..b5dba74 100755 (executable)
@@ -89,6 +89,7 @@ else {
                        $lv->{'perm'} = $in{'perm'};
                        $lv->{'alloc'} = $in{'alloc'};
                        $lv->{'stripe'} = $in{'stripe'} if (!$in{'stripe_def'});
+                       $lv->{'stripesize'} = $in{'stripesize'};
                        }
                $err = &create_logical_volume($lv);
                &error("<pre>$err</pre>") if ($err);