From 35fbb74d119af037208ee2268c4448dcfd258cc3 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Mon, 3 May 2010 10:45:26 -0700 Subject: [PATCH] Handle LV sizes like GiB --- lvm/lvm-lib.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lvm/lvm-lib.pl b/lvm/lvm-lib.pl index 9700bc2b9..3de7ede45 100755 --- a/lvm/lvm-lib.pl +++ b/lvm/lvm-lib.pl @@ -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)