]> git.proxmox.com Git - pve-installer.git/commitdiff
lvm: use space between some calculations for readabillity
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Nov 2022 07:58:39 +0000 (08:58 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Nov 2022 07:58:39 +0000 (08:58 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
proxinstall

index 21fe4cf8fb6bd7ea1a4ffb0f46b7ff1c0d654d51..356569293b1e5778b219cfcc2c19ecd6ea7087f0 100755 (executable)
@@ -1108,7 +1108,7 @@ sub create_lvm_volumes {
     my $space = (($hdgb > 128) ? 16 : ($hdgb/8))*1024*1024;
 
     my $rootsize;
-    my $datasize;
+    my $datasize = 0;
 
     if ($setup->{product} eq 'pve') {
 
@@ -1155,16 +1155,16 @@ sub create_lvm_volumes {
     syscmd("/sbin/lvcreate -Wy --yes -L${rootsize}K -nroot $vgname") == 0 ||
        die "unable to create root volume\n";
 
-    if ($datasize > 4*1024*1024) {
+    if ($datasize > 4 * 1024 * 1024) {
        my $metadatasize = $datasize/100; # default 1% of data
        $metadatasize = 1024*1024 if $metadatasize < 1024*1024; # but at least 1G
        $metadatasize = 16*1024*1024 if $metadatasize > 16*1024*1024; # but at most 16G
 
        # otherwise the metadata is taken out of $minfree
-       $datasize -= 2*$metadatasize;
+       $datasize -= 2 * $metadatasize;
 
        # 1 4MB PE to allow for rounding
-       $datasize -= 4*1024;
+       $datasize -= 4 * 1024;
 
        syscmd("/sbin/lvcreate -Wy --yes -L${datasize}K -ndata $vgname") == 0 ||
            die "unable to create data volume\n";
@@ -1188,7 +1188,7 @@ sub compute_swapsize {
 
     my $swapsize;
     if (defined($config_options->{swapsize})) {
-       $swapsize = $config_options->{swapsize}*1024*1024;
+       $swapsize = $config_options->{swapsize} * 1024 * 1024;
     } else {
        my $ss = int ($total_memory / 1024);
        $ss = 4 if $ss < 4;