From 7e14102a4b1d38efaff0909cf88f38cc6635e354 Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Fri, 23 Apr 2021 12:14:52 +0200 Subject: [PATCH] diskmanage: factor out mounted_blockdevs helper Signed-off-by: Fabian Ebner --- PVE/Diskmanage.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm index 612d976..c188d83 100644 --- a/PVE/Diskmanage.pm +++ b/PVE/Diskmanage.pm @@ -481,10 +481,7 @@ my sub is_ssdlike { return $type eq 'ssd' || $type eq 'nvme'; } -sub get_disks { - my ($disks, $nosmart, $include_partitions) = @_; - my $disklist = {}; - +sub mounted_blockdevs { my $mounted = {}; my $mounts = PVE::ProcFSTools::parse_proc_mounts(); @@ -494,6 +491,15 @@ sub get_disks { $mounted->{abs_path($mount->[0])} = $mount->[1]; }; + return $mounted; +} + +sub get_disks { + my ($disks, $nosmart, $include_partitions) = @_; + my $disklist = {}; + + my $mounted = mounted_blockdevs(); + my $lsblk_info = get_lsblk_info(); my $journalhash = get_ceph_journals($lsblk_info); -- 2.39.2