| 84 | } |
| 85 | |
| 86 | static Result<std::map<unsigned long, std::string>> getFileSystemUUIDOnce() { |
| 87 | auto diskInfoResult = SysResource::scanDiskInfo(); |
| 88 | RETURN_AND_LOG_ON_ERROR(diskInfoResult); |
| 89 | std::map<unsigned long, std::string> deviceIdToDevicePath; |
| 90 | for (auto &info : *diskInfoResult) { |
| 91 | deviceIdToDevicePath[info.deviceId] = info.uuid; |
| 92 | } |
| 93 | return deviceIdToDevicePath; |
| 94 | } |
| 95 | |
| 96 | Result<std::map<unsigned long, std::string>> SysResource::fileSystemUUID(bool force) { |
| 97 | if (force) { |