]> git.proxmox.com Git - pve-storage.git/commitdiff
Diskmanage: replace closure with direct hash access
authorFabian Ebner <f.ebner@proxmox.com>
Tue, 26 Jan 2021 11:45:18 +0000 (12:45 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 6 Feb 2021 12:52:20 +0000 (13:52 +0100)
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/Diskmanage.pm

index 9f482af036ef4c5d4b21837e1c862aadc4218f23..5066232390a848306d3729ff23b0654e376cd4d4 100644 (file)
@@ -479,11 +479,6 @@ sub get_disks {
        $mounted->{abs_path($mount->[0])} = $mount->[1];
     };
 
-    my $dev_is_mounted = sub {
-       my ($dev) = @_;
-       return $mounted->{$dev};
-    };
-
     my $parttype_map = get_parttype_info();
 
     my $journalhash = get_ceph_journals($parttype_map);
@@ -566,7 +561,7 @@ sub get_disks {
 
        $used = 'LVM' if $lvmhash->{$devpath};
 
-       $used = 'mounted' if &$dev_is_mounted($devpath);
+       $used = 'mounted' if $mounted->{$devpath};
 
        $used = 'ZFS' if $zfshash->{$devpath};
 
@@ -620,7 +615,7 @@ sub get_disks {
 
            $found_partitions = 1;
 
-           if (my $mp = &$dev_is_mounted("$partpath/$part")) {
+           if (my $mp = $mounted->{"$partpath/$part"}) {
                $found_mountpoints = 1;
                if ($mp =~ m|^/var/lib/ceph/osd/ceph-(\d+)$|) {
                    $osdid = $1;