return $wearout;
}
+sub dir_is_empty {
+ my ($dir) = @_;
+
+ my $dh = IO::Dir->new ($dir);
+ return 1 if !$dh;
+
+ while (defined(my $tmp = $dh->read)) {
+ next if $tmp eq '.' || $tmp eq '..';
+ $dh->close;
+ return 0;
+ }
+ $dh->close;
+ return 1;
+}
+
sub get_disks {
my ($disk, $nosmart) = @_;
my $disklist = {};
return $mounted->{$dev};
};
- my $dir_is_empty = sub {
- my ($dir) = @_;
-
- my $dh = IO::Dir->new ($dir);
- return 1 if !$dh;
-
- while (defined(my $tmp = $dh->read)) {
- next if $tmp eq '.' || $tmp eq '..';
- $dh->close;
- return 0;
- }
- $dh->close;
- return 1;
- };
-
my $journalhash = get_ceph_journals();
my $zfslist = get_zfs_devices();
$journal_count++ if $journalhash->{"$partpath/$part"};
- if (!&$dir_is_empty("$sysdir/$part/holders") && !$found_lvm) {
+ if (!dir_is_empty("$sysdir/$part/holders") && !$found_lvm) {
$found_dm = 1;
}
});
# multipath, software raid, etc.
# this check comes in last, to show more specific info
# if we have it
- $used = 'Device Mapper' if !$used && !&$dir_is_empty("$sysdir/holders");
+ $used = 'Device Mapper' if !$used && !dir_is_empty("$sysdir/holders");
$disklist->{$dev}->{used} = $used if $used;
$disklist->{$dev}->{osdid} = $osdid;