summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake/interactive.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/diskdrake/interactive.pm')
-rw-r--r--perl-install/diskdrake/interactive.pm17
1 files changed, 11 insertions, 6 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index 0b449a460..898f1de58 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -770,6 +770,13 @@ sub _get_dir_for_online_resize {
return $dir;
}
+sub _set_min_size_from_avail_space {
+ my ($part, $min) = @_;
+ if (defined(my $free = fs::df($part))) {
+ $$min = max($$min, $part->{size} - $free);
+ }
+}
+
sub Resize {
my ($in, $hd, $part) = @_;
my (%nice_resize);
@@ -816,18 +823,16 @@ sub Resize {
$nice_resize{reiserfs} = 1;
if ($part->{isMounted}) {
$min = $part->{size}; #- ensure the user can only increase
- } elsif (defined(my $free = fs::df($part))) {
- $min = max($min, $part->{size} - $free);
+ } else {
+ _set_min_size_from_avail_space($part, \$min);
}
} elsif ($part->{fs_type} eq 'xfs' && isLVM($hd) && $::isStandalone && $part->{isMounted}) {
$min = $part->{size}; #- ensure the user can only increase
$nice_resize{xfs} = 1;
} elsif ($part->{fs_type} eq 'btrfs') {
write_partitions($in, $hd) or return;
- if (defined(my $free = fs::df($part))) {
- $nice_resize{btrfs} = 1;
- $min = max($min, $part->{size} - $free);
- }
+ $nice_resize{btrfs} = 1;
+ _set_min_size_from_avail_space($part, \$min);
}
#- make sure that even after normalizing the size to cylinder boundaries, the minimun will be saved,
#- this save at least a cylinder (less than 8Mb).