diff --git a/headers/private/kernel/boot/partitions.h b/headers/private/kernel/boot/partitions.h index 81651fb3f3..731ca42f27 100644 --- a/headers/private/kernel/boot/partitions.h +++ b/headers/private/kernel/boot/partitions.h @@ -30,8 +30,8 @@ class Partition : public Node, public partition_data { status_t Mount(Directory **_fileSystem = NULL, bool isBootDevice = false); status_t Scan(bool mountFileSystems, bool isBootDevice = false); - void SetParent(Partition *parent) { fParent = parent; } - Partition *Parent() const { return fParent; } + void SetParent(Partition *parent); + Partition *Parent() const; bool IsFileSystem() const { return fIsFileSystem; } bool IsPartitioningSystem() const { return fIsPartitioningSystem; } diff --git a/src/system/boot/loader/partitions.cpp b/src/system/boot/loader/partitions.cpp index 9126bc7499..4375504701 100644 --- a/src/system/boot/loader/partitions.cpp +++ b/src/system/boot/loader/partitions.cpp @@ -104,6 +104,8 @@ Partition::Partition(int fd) fIsFileSystem(false), fIsPartitioningSystem(false) { + TRACE(("%p Partition::Partition\n", this)); + memset((partition_data *)this, 0, sizeof(partition_data)); id = (partition_id)this; @@ -114,10 +116,27 @@ Partition::Partition(int fd) Partition::~Partition() { + TRACE(("%p Partition::~Partition\n", this)); close(fFD); } +void +Partition::SetParent(Partition *parent) +{ + TRACE(("%p Partition::SetParent %p\n", this, parent)); + fParent = parent; +} + + +Partition * +Partition::Parent() const +{ + TRACE(("%p Partition::Parent is %p\n", this, fParent)); + return fParent; +} + + ssize_t Partition::ReadAt(void *cookie, off_t position, void *buffer, size_t bufferSize) { @@ -174,6 +193,7 @@ Partition * Partition::AddChild() { Partition *child = new Partition(fFD); + TRACE(("%p Partition::AddChild %p\n", this, child)); if (child == NULL) return NULL; @@ -188,7 +208,8 @@ Partition::AddChild() status_t Partition::_Mount(file_system_module_info *module, Directory **_fileSystem) { - TRACE(("check for file_system: %s\n", module->pretty_name)); + TRACE(("%p Partition::_Mount check for file_system: %s\n", + this, module->pretty_name)); Directory *fileSystem; if (module->get_file_system(this, &fileSystem) == B_OK) { @@ -230,7 +251,7 @@ Partition::Scan(bool mountFileSystems, bool isBootDevice) { // scan for partitions first (recursively all eventual children as well) - TRACE(("Partition::Scan()\n")); + TRACE(("%p Partition::Scan()\n", this)); // if we were not booted from the real boot device, we won't scan // the device we were booted from (which is likely to be a slow @@ -314,8 +335,8 @@ Partition::Scan(bool mountFileSystems, bool isBootDevice) Partition *child = NULL; while ((child = (Partition *)iterator.Next()) != NULL) { - TRACE(("*** scan child %p (start = %Ld, size = %Ld, parent = %p)!\n", - child, child->offset, child->size, child->Parent())); + TRACE(("%p Partition::Scan: *** scan child %p (start = %Ld, size = %Ld, parent = %p)!\n", + this, child, child->offset, child->size, child->Parent())); child->Scan(mountFileSystems);