Added more debugging code. The partition code appears to be using objects that have been destroyed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23165 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -30,8 +30,8 @@ class Partition : public Node, public partition_data {
|
|||||||
status_t Mount(Directory **_fileSystem = NULL, bool isBootDevice = false);
|
status_t Mount(Directory **_fileSystem = NULL, bool isBootDevice = false);
|
||||||
status_t Scan(bool mountFileSystems, bool isBootDevice = false);
|
status_t Scan(bool mountFileSystems, bool isBootDevice = false);
|
||||||
|
|
||||||
void SetParent(Partition *parent) { fParent = parent; }
|
void SetParent(Partition *parent);
|
||||||
Partition *Parent() const { return fParent; }
|
Partition *Parent() const;
|
||||||
|
|
||||||
bool IsFileSystem() const { return fIsFileSystem; }
|
bool IsFileSystem() const { return fIsFileSystem; }
|
||||||
bool IsPartitioningSystem() const { return fIsPartitioningSystem; }
|
bool IsPartitioningSystem() const { return fIsPartitioningSystem; }
|
||||||
|
|||||||
@@ -104,6 +104,8 @@ Partition::Partition(int fd)
|
|||||||
fIsFileSystem(false),
|
fIsFileSystem(false),
|
||||||
fIsPartitioningSystem(false)
|
fIsPartitioningSystem(false)
|
||||||
{
|
{
|
||||||
|
TRACE(("%p Partition::Partition\n", this));
|
||||||
|
|
||||||
memset((partition_data *)this, 0, sizeof(partition_data));
|
memset((partition_data *)this, 0, sizeof(partition_data));
|
||||||
id = (partition_id)this;
|
id = (partition_id)this;
|
||||||
|
|
||||||
@@ -114,10 +116,27 @@ Partition::Partition(int fd)
|
|||||||
|
|
||||||
Partition::~Partition()
|
Partition::~Partition()
|
||||||
{
|
{
|
||||||
|
TRACE(("%p Partition::~Partition\n", this));
|
||||||
close(fFD);
|
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
|
ssize_t
|
||||||
Partition::ReadAt(void *cookie, off_t position, void *buffer, size_t bufferSize)
|
Partition::ReadAt(void *cookie, off_t position, void *buffer, size_t bufferSize)
|
||||||
{
|
{
|
||||||
@@ -174,6 +193,7 @@ Partition *
|
|||||||
Partition::AddChild()
|
Partition::AddChild()
|
||||||
{
|
{
|
||||||
Partition *child = new Partition(fFD);
|
Partition *child = new Partition(fFD);
|
||||||
|
TRACE(("%p Partition::AddChild %p\n", this, child));
|
||||||
if (child == NULL)
|
if (child == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@@ -188,7 +208,8 @@ Partition::AddChild()
|
|||||||
status_t
|
status_t
|
||||||
Partition::_Mount(file_system_module_info *module, Directory **_fileSystem)
|
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;
|
Directory *fileSystem;
|
||||||
if (module->get_file_system(this, &fileSystem) == B_OK) {
|
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)
|
// 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
|
// 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
|
// 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;
|
Partition *child = NULL;
|
||||||
|
|
||||||
while ((child = (Partition *)iterator.Next()) != NULL) {
|
while ((child = (Partition *)iterator.Next()) != NULL) {
|
||||||
TRACE(("*** scan child %p (start = %Ld, size = %Ld, parent = %p)!\n",
|
TRACE(("%p Partition::Scan: *** scan child %p (start = %Ld, size = %Ld, parent = %p)!\n",
|
||||||
child, child->offset, child->size, child->Parent()));
|
this, child, child->offset, child->size, child->Parent()));
|
||||||
|
|
||||||
child->Scan(mountFileSystems);
|
child->Scan(mountFileSystems);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user