diff --git a/headers/private/kernel/disk_device_manager/KDiskDeviceManager.h b/headers/private/kernel/disk_device_manager/KDiskDeviceManager.h index 80494ff951..72eb0dbed1 100644 --- a/headers/private/kernel/disk_device_manager/KDiskDeviceManager.h +++ b/headers/private/kernel/disk_device_manager/KDiskDeviceManager.h @@ -91,6 +91,7 @@ public: int32 CountDiskSystems(); KDiskSystem *NextDiskSystem(int32 *cookie); + KDiskSystem *LoadDiskSystem(const char *name); KDiskSystem *LoadDiskSystem(disk_system_id id); KDiskSystem *LoadNextDiskSystem(int32 *cookie); diff --git a/src/kernel/core/disk_device_manager/KDiskDeviceManager.cpp b/src/kernel/core/disk_device_manager/KDiskDeviceManager.cpp index 8244481ba7..6f19fde3b6 100644 --- a/src/kernel/core/disk_device_manager/KDiskDeviceManager.cpp +++ b/src/kernel/core/disk_device_manager/KDiskDeviceManager.cpp @@ -664,6 +664,19 @@ KDiskDeviceManager::NextDiskSystem(int32 *cookie) return NULL; } +// LoadDiskSystem +KDiskSystem * +KDiskDeviceManager::LoadDiskSystem(const char *name) +{ + KDiskSystem *diskSystem = NULL; + if (ManagerLocker locker = this) { + diskSystem = FindDiskSystem(name); + if (diskSystem && diskSystem->Load() != B_OK) + diskSystem = NULL; + } + return diskSystem; +} + // LoadDiskSystem KDiskSystem * KDiskDeviceManager::LoadDiskSystem(disk_system_id id)