Handle LV sizes like GiB
authorJamie Cameron <jcameron@webmin.com>
Mon, 3 May 2010 17:45:26 +0000 (10:45 -0700)
committerJamie Cameron <jcameron@webmin.com>
Mon, 3 May 2010 17:45:26 +0000 (10:45 -0700)
lvm/lvm-lib.pl

index 9700bc2..3de7ede 100755 (executable)
@@ -196,10 +196,11 @@ return @rv;
 sub mult_units
 {
 local ($n, $u) = @_;
-return $n*(uc($u) eq "KB" ? 1 :
-          uc($u) eq "MB" ? 1024 :
-          uc($u) eq "GB" ? 1024*1024 :
-          uc($u) eq "TB" ? 1024*1024*1024 : 1);
+return $n*(uc($u) eq "KB" || uc($u) eq "KIB" ? 1 :
+          uc($u) eq "MB" || uc($u) eq "MIB" ? 1024 :
+          uc($u) eq "GB" || uc($u) eq "GIB" ? 1024*1024 :
+          uc($u) eq "TB" || uc($u) eq "TIB" ? 1024*1024*1024 :
+          uc($u) eq "PB" || uc($u) eq "PIB" ? 1024*1024*1024 : 1);
 }
 
 # delete_volume_group(&vg)