summaryrefslogtreecommitdiffstats
path: root/lvm.py
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2002-06-11 20:52:42 +0000
committerMike Fulbright <msf@redhat.com>2002-06-11 20:52:42 +0000
commitffe5bbdb35e0ed59df9fa4c3cad9abf3e1cec972 (patch)
tree1a3e43e334afc9d5cbc2ffd85852f1943aff56e3 /lvm.py
parentff689ad29eb893e2928707a213f6acf96d564aa2 (diff)
downloadanaconda-ffe5bbdb35e0ed59df9fa4c3cad9abf3e1cec972.tar.gz
anaconda-ffe5bbdb35e0ed59df9fa4c3cad9abf3e1cec972.tar.xz
anaconda-ffe5bbdb35e0ed59df9fa4c3cad9abf3e1cec972.zip
some utility LVM funcs
Diffstat (limited to 'lvm.py')
-rw-r--r--lvm.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/lvm.py b/lvm.py
index b831c31aa..3d6f7d36e 100644
--- a/lvm.py
+++ b/lvm.py
@@ -129,3 +129,19 @@ def clampLVSizeRequest(size, pe):
return size
else:
return ((long((size*1024L)/pe)+1L)*pe)/1024
+
+def clampPVSize(pvsize, pesize):
+ """Given a PV size and a PE, returns the usable space of the PV.
+
+ pvsize - size (in MB) of PV request
+ pesize - PE size (in KB)
+ """
+
+ return (long(pvsize*1024/pesize)*pesize)/1024
+
+def getMaxLVSize(pe):
+ """Given a PE size in KB, returns maximum size (in MB) of a logical volume.
+
+ pe - PE size in KB
+ """
+ return pe*64