feat: temporarily disabled NVMeSmart reader because of a problem with the new macOS Sonoma

This commit is contained in:
Serhiy Mytrovtsiy
2023-10-18 16:40:38 +02:00
parent 66641a1817
commit 134a42f27f
2 changed files with 4 additions and 4 deletions

View File

@@ -61,7 +61,6 @@ internal class CapacityReader: Reader<Disks> {
if let path = d.path {
self.list.updateFreeSize(idx, newValue: self.freeDiskSpaceInBytes(path))
self.list.updateSMARTData(idx, smart: self.getSMARTDetails(for: BSDName))
}
continue
@@ -72,7 +71,6 @@ internal class CapacityReader: Reader<Disks> {
d.free = self.freeDiskSpaceInBytes(path)
d.size = self.totalDiskSpaceInBytes(path)
}
d.smart = self.getSMARTDetails(for: BSDName)
self.list.append(d)
self.list.sort()
}
@@ -162,13 +160,15 @@ internal class CapacityReader: Reader<Disks> {
pluginInterface?.pointee?.pointee.QueryInterface(pluginInterface, CFUUIDGetUUIDBytes(kIONVMeSMARTInterfaceID), $0) ?? KERN_NOT_FOUND
}
}
guard result == kIOReturnSuccess else { return nil }
defer {
if smartInterface != nil {
_ = pluginInterface?.pointee?.pointee.Release(smartInterface)
}
}
guard result == KERN_SUCCESS, let smart = smartInterface?.pointee else { return nil }
guard let smart = smartInterface?.pointee else { return nil }
var smartData: nvme_smart_log = nvme_smart_log()
guard smart.pointee.SMARTReadData(smartInterface, &smartData) == kIOReturnSuccess else { return nil }