[pve-devel] [PATCH storage 02/11] diskmanage: factor out mounted_blockdevs helper
Fabian Ebner
f.ebner at proxmox.com
Fri Apr 23 12:14:52 CEST 2021
Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
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.20.1
More information about the pve-devel
mailing list