From 34bc7f03ed6f30ee840524c5b7b8f20ac91d9ade Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 7 Jul 2009 13:10:52 +0000 Subject: [PATCH] Patch by Bryce Groff: * SetBusy(): Use AddFlags() instead of SetFlags() so that the other flags aren't cleared. * AddChild(): Publish the newly added child partition. Otherwise no-one can do anything with it without rebooting first. Other children may need to be republished under a new name, if their index changes, which doesn't happen yet. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31444 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/disk_device_manager/KPartition.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/disk_device_manager/KPartition.cpp b/src/system/kernel/disk_device_manager/KPartition.cpp index 513aa1d078..7a93243bf5 100644 --- a/src/system/kernel/disk_device_manager/KPartition.cpp +++ b/src/system/kernel/disk_device_manager/KPartition.cpp @@ -243,7 +243,7 @@ void KPartition::SetBusy(bool busy) { if (busy) - SetFlags(B_PARTITION_BUSY); + AddFlags(B_PARTITION_BUSY); else ClearFlags(B_PARTITION_BUSY); } @@ -771,6 +771,10 @@ KPartition::AddChild(KPartition *partition, int32 index) fPartitionData.child_count++; partition->SetParent(this); partition->SetDevice(Device()); + // publish to devfs + error = PublishDevice(); + if (error != B_OK) + return error; // notify listeners FireChildAdded(partition, index); return B_OK; @@ -896,7 +900,7 @@ KPartition::VisitEachDescendant(KPartitionVisitor *visitor) } if (visitor->VisitPost(this)) return this; - return NULL; + return NULL; }