Implemented a preliminary disk device scanning in KDiskDeviceManager.

Some changes to KPartition, KDiskDevice, KDiskSystem on this way.
Still missing is KPartition::Publish() and its invocation in
KDiskDeviceManager. Then everything should be in place to start with
porting the scanning parts of our disk system modules.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3486 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2003-06-12 22:21:10 +00:00
parent f3df767f76
commit ef9b1b52ee
8 changed files with 316 additions and 15 deletions
@@ -44,12 +44,13 @@ public:
KDiskDevice *RegisterDevice(const char *path, bool noShadow = true);
KDiskDevice *RegisterDevice(partition_id id, bool noShadow = true);
KDiskDevice *RegisterNextDevice(int32 *cookie);
KPartition *RegisterPartition(const char *path, bool noShadow = true);
KPartition *RegisterPartition(partition_id id, bool noShadow = true);
// manager must be locked
int32 CountDiskDevices();
KDiskDevice *DiskDeviceAt(int32 index);
int32 CountDevices();
KDiskDevice *DeviceAt(int32 index);
bool PartitionAdded(KPartition *partition); // implementation internal
bool PartitionRemoved(KPartition *partition); //
@@ -74,16 +75,24 @@ public:
int32 CountDiskSystems();
KDiskSystem *DiskSystemAt(int32 index);
KDiskSystem *LoadDiskSystem(disk_system_id id);
KDiskSystem *LoadNextDiskSystem(int32 *cookie);
// Watching
// TODO: Watching service for the kernel. The userland watching is handled
// by the registrar.
status_t InitialDeviceScan();
private:
status_t _AddPartitioningSystem(const char *name);
status_t _AddFileSystem(const char *name);
status_t _AddDiskSystem(KDiskSystem *diskSystem);
status_t _Scan(const char *path);
status_t _ScanPartition(KPartition *partition);
BLocker fLock;
List<KDiskDevice*> fDevices; // TODO: Optimize!
List<KPartition*> fPartitions; //