From 164d84bb109e2778799a6b5a7d40c15d48b939a3 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 2 Feb 2005 02:35:16 +0000 Subject: [PATCH] Switched to new DoublyLinkedList class. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11193 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/boot/vfs.h | 8 +++----- src/kernel/boot/loader/partitions.cpp | 8 +++++--- src/kernel/boot/loader/vfs.cpp | 5 ++--- src/kernel/boot/platform/bios_ia32/devices.cpp | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/headers/private/kernel/boot/vfs.h b/headers/private/kernel/boot/vfs.h index 6f66d5e814..09a654d307 100644 --- a/headers/private/kernel/boot/vfs.h +++ b/headers/private/kernel/boot/vfs.h @@ -16,7 +16,7 @@ /** This is the base class for all VFS nodes */ -class Node { +class Node : public DoublyLinkedListLinkImpl { public: Node(); virtual ~Node(); @@ -35,14 +35,12 @@ class Node { status_t Acquire(); status_t Release(); - DoublyLinked::Link fLink; - protected: int32 fRefCount; }; -typedef DoublyLinked::List NodeList; -typedef DoublyLinked::Iterator NodeIterator; +typedef DoublyLinkedList NodeList; +typedef NodeList::Iterator NodeIterator; class Directory : public Node { diff --git a/src/kernel/boot/loader/partitions.cpp b/src/kernel/boot/loader/partitions.cpp index 9c3cc58a9d..5195c38843 100644 --- a/src/kernel/boot/loader/partitions.cpp +++ b/src/kernel/boot/loader/partitions.cpp @@ -227,7 +227,7 @@ Partition::Scan(bool mountFileSystems) // now that we've found something, check our children // out as well! - NodeIterator iterator = fChildren.Iterator(); + NodeIterator iterator = fChildren.GetIterator(); Partition *child = NULL; while ((child = (Partition *)iterator.Next()) != NULL) { @@ -245,8 +245,10 @@ Partition::Scan(bool mountFileSystems) // remove all unused children (we keep only file systems) - while ((child = (Partition *)fChildren.RemoveHead()) != NULL) + while ((child = (Partition *)fChildren.Head()) != NULL) { + fChildren.Remove(child); delete child; + } // remember the module name that identified us fModuleName = module->module.name; @@ -290,7 +292,7 @@ add_partitions_for(int fd, bool mountFileSystems) // if not, we'll need to tell the children that their parent is gone - NodeIterator iterator = gPartitions.Iterator(); + NodeIterator iterator = gPartitions.GetIterator(); Partition *child = NULL; while ((child = (Partition *)iterator.Next()) != NULL) { diff --git a/src/kernel/boot/loader/vfs.cpp b/src/kernel/boot/loader/vfs.cpp index 614101a586..23370d2c47 100644 --- a/src/kernel/boot/loader/vfs.cpp +++ b/src/kernel/boot/loader/vfs.cpp @@ -68,7 +68,6 @@ Node::Node() : fRefCount(1) { - fLink.next = fLink.prev = NULL; } @@ -366,7 +365,7 @@ status_t mount_file_systems(stage2_args *args) { // mount other partitions on boot device (if any) - NodeIterator iterator = gPartitions.Iterator(); + NodeIterator iterator = gPartitions.GetIterator(); Partition *partition = NULL; while ((partition = (Partition *)iterator.Next()) != NULL) { @@ -387,7 +386,7 @@ mount_file_systems(stage2_args *args) if (status < B_OK) return status; - iterator = gBootDevices.Iterator(); + iterator = gBootDevices.GetIterator(); Node *device = NULL, *last = NULL; while ((device = iterator.Next()) != NULL) { // don't scan former boot device again diff --git a/src/kernel/boot/platform/bios_ia32/devices.cpp b/src/kernel/boot/platform/bios_ia32/devices.cpp index f07ee2570f..457f6898e7 100644 --- a/src/kernel/boot/platform/bios_ia32/devices.cpp +++ b/src/kernel/boot/platform/bios_ia32/devices.cpp @@ -442,7 +442,7 @@ platform_get_boot_partition(struct stage2_args *args, Node *bootDevice, dprintf("boot partition offset: %Ld\n", offset); - NodeIterator iterator = list->Iterator(); + NodeIterator iterator = list->GetIterator(); boot::Partition *partition = NULL; while ((partition = (boot::Partition *)iterator.Next()) != NULL) { dprintf("partition offset = %Ld, size = %Ld\n", partition->offset, partition->size);