Now uses the DoublyLinked::List class instead of the C list stuff.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5016 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
namespace boot {
|
namespace boot {
|
||||||
|
|
||||||
class Partition : public partition_data, public Node {
|
class Partition : public Node, public partition_data {
|
||||||
public:
|
public:
|
||||||
Partition(int deviceFD);
|
Partition(int deviceFD);
|
||||||
virtual ~Partition();
|
virtual ~Partition();
|
||||||
@@ -31,13 +31,11 @@ class Partition : public partition_data, public Node {
|
|||||||
Partition *Parent() const { return fParent; }
|
Partition *Parent() const { return fParent; }
|
||||||
bool IsFileSystem() const { return fIsFileSystem; }
|
bool IsFileSystem() const { return fIsFileSystem; }
|
||||||
|
|
||||||
static size_t LinkOffset() { return sizeof(partition_data); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetParent(Partition *parent) { fParent = parent; }
|
void SetParent(Partition *parent) { fParent = parent; }
|
||||||
|
|
||||||
int fFD;
|
int fFD;
|
||||||
list fChildren;
|
NodeList fChildren;
|
||||||
Partition *fParent;
|
Partition *fParent;
|
||||||
bool fIsFileSystem;
|
bool fIsFileSystem;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <SupportDefs.h>
|
#include <SupportDefs.h>
|
||||||
#include <util/list.h>
|
#include <boot/vfs.h>
|
||||||
|
|
||||||
|
|
||||||
struct stage2_args;
|
struct stage2_args;
|
||||||
@@ -39,8 +39,8 @@ namespace boot {
|
|||||||
|
|
||||||
// these functions have to be implemented in C++
|
// these functions have to be implemented in C++
|
||||||
extern status_t platform_get_boot_device(struct stage2_args *args, Node **_device);
|
extern status_t platform_get_boot_device(struct stage2_args *args, Node **_device);
|
||||||
extern status_t platform_add_block_devices(struct stage2_args *args, struct list *devicesList);
|
extern status_t platform_add_block_devices(struct stage2_args *args, NodeList *devicesList);
|
||||||
extern status_t platform_get_boot_partition(struct stage2_args *args, struct list *partitions,
|
extern status_t platform_get_boot_partition(struct stage2_args *args, NodeList *partitions,
|
||||||
boot::Partition **_partition);
|
boot::Partition **_partition);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include <SupportDefs.h>
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
#include <util/list.h>
|
#include <util/DoublyLinkedList.h>
|
||||||
#include <boot/stage2_args.h>
|
#include <boot/stage2_args.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -34,11 +34,15 @@ class Node {
|
|||||||
status_t Acquire();
|
status_t Acquire();
|
||||||
status_t Release();
|
status_t Release();
|
||||||
|
|
||||||
|
DoublyLinked::Link fLink;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
list_link fLink;
|
|
||||||
int32 fRefCount;
|
int32 fRefCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef DoublyLinked::List<Node> NodeList;
|
||||||
|
typedef DoublyLinked::Iterator<Node> NodeIterator;
|
||||||
|
|
||||||
|
|
||||||
class Directory : public Node {
|
class Directory : public Node {
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user