From 705af468108916bba0dd4fabbe6a03d79bfbbc4a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 1 Jul 2005 07:24:52 +0000 Subject: create vg_free_space() --- perl-install/fs/get.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'perl-install/fs') diff --git a/perl-install/fs/get.pm b/perl-install/fs/get.pm index 1db2d3002..02e18fed5 100644 --- a/perl-install/fs/get.pm +++ b/perl-install/fs/get.pm @@ -55,11 +55,17 @@ sub hds_fstab { map { partition_table::get_normal_parts($_) } @_; } +sub vg_free_space { + my ($hd) = @_; + my @parts = partition_table::get_normal_parts($hd); + $hd->{totalsectors} - sum map { $_->{size} } @parts; +} + sub hds_fstab_and_holes { map { if (isLVM($_)) { my @parts = partition_table::get_normal_parts($_); - my $free = $_->{totalsectors} - sum map { $_->{size} } @parts; + my $free = vg_free_space($_); my $free_part = { start => 0, size => $free, pt_type => 0, rootDevice => $_->{VG_name} }; @parts, if_($free >= $_->cylinder_size, $free_part); } else { -- cgit v1.2.1