From 08427f8cfcbd05324eb55665ff09c8fe31402d37 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 14 Jun 2003 00:08:56 +0000 Subject: [PATCH] Publish partitions in _ScanPartition() and unpublish them in the destructor. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3510 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../core/disk_device_manager/KDiskDeviceManager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/kernel/core/disk_device_manager/KDiskDeviceManager.cpp b/src/kernel/core/disk_device_manager/KDiskDeviceManager.cpp index 34bea4f366..76121c6006 100644 --- a/src/kernel/core/disk_device_manager/KDiskDeviceManager.cpp +++ b/src/kernel/core/disk_device_manager/KDiskDeviceManager.cpp @@ -64,6 +64,9 @@ DBG(OUT("file system: %s\n", moduleName)); // destructor KDiskDeviceManager::~KDiskDeviceManager() { + // unpublish all partitions (only needed for testing) + for (int32 i = 0; KPartition *partition = fPartitions.ItemAt(i); i++) + partition->UnpublishDevice(); } // InitCheck @@ -548,6 +551,10 @@ KDiskDeviceManager::_ScanPartition(KPartition *partition) char partitionPath[B_PATH_NAME_LENGTH]; partition->GetPath(partitionPath); DBG(OUT("KDiskDeviceManager::_ScanPartition(%s)\n", partitionPath)); + // publish the partition + status_t error = partition->PublishDevice(); + if (error != B_OK) + return error; // find the disk system that returns the best priority for this partition float bestPriority = -1; KDiskSystem *bestDiskSystem = NULL; @@ -575,7 +582,6 @@ DBG(OUT(" returned: %f\n", priority)); } } // now, if we have found a disk system, let it scan the partition - status_t error = B_OK; if (bestDiskSystem) { DBG(OUT(" scanning with: %s\n", bestDiskSystem->Name())); error = bestDiskSystem->Scan(partition, bestCookie);