* Implemented what was left to do for KDiskDevice and KPartition

management regarding removal and deletion of objects.
* Fixed the file disk system related stuff. KFileDiskSystem now uses the
  virtualdrive driver. The former method was seemed simple and brilliant,
  but the B_SET_PARTITION ioctl wouldn't work.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3650 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2003-06-24 23:56:16 +00:00
parent 7a424c3923
commit b23394f957
8 changed files with 274 additions and 101 deletions
@@ -36,6 +36,13 @@ public:
void Unregister();
int32 CountReferences() const;
void MarkObsolete();
// called by the manager only
bool IsObsolete() const;
virtual bool PrepareForRemoval();
virtual bool PrepareForDeletion();
status_t Open(int flags, int *fd);
virtual status_t PublishDevice();
virtual status_t UnpublishDevice();
@@ -122,7 +129,9 @@ public:
status_t AddChild(KPartition *partition, int32 index = -1);
status_t CreateChild(partition_id id, int32 index,
KPartition **child = NULL);
KPartition *RemoveChild(int32 index);
bool RemoveChild(int32 index);
bool RemoveChild(KPartition *child);
bool RemoveAllChildren();
KPartition *ChildAt(int32 index) const;
int32 CountChildren() const;
@@ -137,7 +146,6 @@ public:
void SetDiskSystem(KDiskSystem *diskSystem);
KDiskSystem *DiskSystem() const;
void SetParentDiskSystem(KDiskSystem *diskSystem);
KDiskSystem *ParentDiskSystem() const;
// When setting a disk system, it must already be loaded.
// The partition will load it too, hence it won't be unloaded before
@@ -161,8 +169,8 @@ protected:
KDiskDevice *fDevice;
KPartition *fParent;
KDiskSystem *fDiskSystem;
KDiskSystem *fParentDiskSystem;
int32 fReferenceCount;
bool fObsolete;
static int32 fNextID;
};