* Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27114 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -53,7 +53,6 @@ static const char *kFileSystemPrefix = "file_systems";
|
|||||||
KDiskDeviceManager* KDiskDeviceManager::sDefaultManager = NULL;
|
KDiskDeviceManager* KDiskDeviceManager::sDefaultManager = NULL;
|
||||||
|
|
||||||
|
|
||||||
// GetPartitionID
|
|
||||||
struct GetPartitionID {
|
struct GetPartitionID {
|
||||||
inline partition_id operator()(const KPartition* partition) const
|
inline partition_id operator()(const KPartition* partition) const
|
||||||
{
|
{
|
||||||
@@ -61,7 +60,7 @@ struct GetPartitionID {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// GetDiskSystemID
|
|
||||||
struct GetDiskSystemID {
|
struct GetDiskSystemID {
|
||||||
inline disk_system_id operator()(const KDiskSystem* system) const
|
inline disk_system_id operator()(const KDiskSystem* system) const
|
||||||
{
|
{
|
||||||
@@ -70,26 +69,25 @@ struct GetDiskSystemID {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// PartitionMap
|
|
||||||
struct KDiskDeviceManager::PartitionMap : VectorMap<partition_id, KPartition*,
|
struct KDiskDeviceManager::PartitionMap : VectorMap<partition_id, KPartition*,
|
||||||
VectorMapEntryStrategy::ImplicitKey<partition_id, KPartition*,
|
VectorMapEntryStrategy::ImplicitKey<partition_id, KPartition*,
|
||||||
GetPartitionID> > {
|
GetPartitionID> > {
|
||||||
};
|
};
|
||||||
|
|
||||||
// DeviceMap
|
|
||||||
struct KDiskDeviceManager::DeviceMap : VectorMap<partition_id, KDiskDevice*,
|
struct KDiskDeviceManager::DeviceMap : VectorMap<partition_id, KDiskDevice*,
|
||||||
VectorMapEntryStrategy::ImplicitKey<partition_id, KDiskDevice*,
|
VectorMapEntryStrategy::ImplicitKey<partition_id, KDiskDevice*,
|
||||||
GetPartitionID> > {
|
GetPartitionID> > {
|
||||||
};
|
};
|
||||||
|
|
||||||
// DiskSystemMap
|
|
||||||
struct KDiskDeviceManager::DiskSystemMap : VectorMap<disk_system_id,
|
struct KDiskDeviceManager::DiskSystemMap : VectorMap<disk_system_id,
|
||||||
KDiskSystem*,
|
KDiskSystem*,
|
||||||
VectorMapEntryStrategy::ImplicitKey<disk_system_id, KDiskSystem*,
|
VectorMapEntryStrategy::ImplicitKey<disk_system_id, KDiskSystem*,
|
||||||
GetDiskSystemID> > {
|
GetDiskSystemID> > {
|
||||||
};
|
};
|
||||||
|
|
||||||
// PartitionSet
|
|
||||||
struct KDiskDeviceManager::PartitionSet : VectorSet<KPartition*> {
|
struct KDiskDeviceManager::PartitionSet : VectorSet<KPartition*> {
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -118,11 +116,11 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// DeviceWatcher
|
|
||||||
class KDiskDeviceManager::DeviceWatcher : public NotificationListener {
|
class KDiskDeviceManager::DeviceWatcher : public NotificationListener {
|
||||||
public:
|
public:
|
||||||
DeviceWatcher(KDiskDeviceManager* manager)
|
DeviceWatcher(KDiskDeviceManager* manager)
|
||||||
: fManager(manager)
|
:
|
||||||
|
fManager(manager)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,6 +228,7 @@ KDiskDeviceManager::~KDiskDeviceManager()
|
|||||||
PartitionRegistrar _(device);
|
PartitionRegistrar _(device);
|
||||||
_RemoveDevice(device);
|
_RemoveDevice(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
// some sanity checks
|
// some sanity checks
|
||||||
if (fPartitions->Count() > 0) {
|
if (fPartitions->Count() > 0) {
|
||||||
DBG(OUT("WARNING: There are still %ld unremoved partitions!\n",
|
DBG(OUT("WARNING: There are still %ld unremoved partitions!\n",
|
||||||
@@ -264,22 +263,20 @@ KDiskDeviceManager::~KDiskDeviceManager()
|
|||||||
delete fObsoletePartitions;
|
delete fObsoletePartitions;
|
||||||
}
|
}
|
||||||
|
|
||||||
// InitCheck
|
|
||||||
status_t
|
status_t
|
||||||
KDiskDeviceManager::InitCheck() const
|
KDiskDeviceManager::InitCheck() const
|
||||||
{
|
{
|
||||||
if (!fPartitions || !fDevices || !fDiskSystems || !fObsoletePartitions)
|
if (!fPartitions || !fDevices || !fDiskSystems || !fObsoletePartitions)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
return (fLock.Sem() >= 0 ? B_OK : fLock.Sem());
|
return fLock.Sem() >= 0 ? B_OK : fLock.Sem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** This creates the system's default DiskDeviceManager.
|
/*! This creates the system's default DiskDeviceManager.
|
||||||
* The creation is not thread-safe, and shouldn't be done
|
The creation is not thread-safe, and shouldn't be done more than once.
|
||||||
* more than once.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
KDiskDeviceManager::CreateDefault()
|
KDiskDeviceManager::CreateDefault()
|
||||||
{
|
{
|
||||||
@@ -294,11 +291,9 @@ KDiskDeviceManager::CreateDefault()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** This deletes the default DiskDeviceManager. The
|
/*! This deletes the default DiskDeviceManager. The deletion is not
|
||||||
* deletion is not thread-safe either, you should
|
thread-safe either, you should make sure that it's called only once.
|
||||||
* make sure that it's called only once.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
KDiskDeviceManager::DeleteDefault()
|
KDiskDeviceManager::DeleteDefault()
|
||||||
{
|
{
|
||||||
@@ -306,28 +301,28 @@ KDiskDeviceManager::DeleteDefault()
|
|||||||
sDefaultManager = NULL;
|
sDefaultManager = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default
|
|
||||||
KDiskDeviceManager*
|
KDiskDeviceManager*
|
||||||
KDiskDeviceManager::Default()
|
KDiskDeviceManager::Default()
|
||||||
{
|
{
|
||||||
return sDefaultManager;
|
return sDefaultManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lock
|
|
||||||
bool
|
bool
|
||||||
KDiskDeviceManager::Lock()
|
KDiskDeviceManager::Lock()
|
||||||
{
|
{
|
||||||
return fLock.Lock();
|
return fLock.Lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unlock
|
|
||||||
void
|
void
|
||||||
KDiskDeviceManager::Unlock()
|
KDiskDeviceManager::Unlock()
|
||||||
{
|
{
|
||||||
fLock.Unlock();
|
fLock.Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
// FindDevice
|
|
||||||
KDiskDevice*
|
KDiskDevice*
|
||||||
KDiskDeviceManager::FindDevice(const char* path)
|
KDiskDeviceManager::FindDevice(const char* path)
|
||||||
{
|
{
|
||||||
@@ -338,7 +333,7 @@ KDiskDeviceManager::FindDevice(const char *path)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FindDevice
|
|
||||||
KDiskDevice*
|
KDiskDevice*
|
||||||
KDiskDeviceManager::FindDevice(partition_id id, bool deviceOnly)
|
KDiskDeviceManager::FindDevice(partition_id id, bool deviceOnly)
|
||||||
{
|
{
|
||||||
@@ -350,7 +345,7 @@ KDiskDeviceManager::FindDevice(partition_id id, bool deviceOnly)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FindPartition
|
|
||||||
KPartition*
|
KPartition*
|
||||||
KDiskDeviceManager::FindPartition(const char* path)
|
KDiskDeviceManager::FindPartition(const char* path)
|
||||||
{
|
{
|
||||||
@@ -359,9 +354,9 @@ KDiskDeviceManager::FindPartition(const char *path)
|
|||||||
if (partitionPath.InitCheck() != B_OK)
|
if (partitionPath.InitCheck() != B_OK)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for (PartitionMap::Iterator it = fPartitions->Begin();
|
for (PartitionMap::Iterator iterator = fPartitions->Begin();
|
||||||
it != fPartitions->End(); ++it) {
|
iterator != fPartitions->End(); ++iterator) {
|
||||||
KPartition *partition = it->Value();
|
KPartition* partition = iterator->Value();
|
||||||
if (partition->GetPath(&partitionPath) == B_OK
|
if (partition->GetPath(&partitionPath) == B_OK
|
||||||
&& partitionPath == path) {
|
&& partitionPath == path) {
|
||||||
return partition;
|
return partition;
|
||||||
@@ -371,18 +366,18 @@ KDiskDeviceManager::FindPartition(const char *path)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FindPartition
|
|
||||||
KPartition*
|
KPartition*
|
||||||
KDiskDeviceManager::FindPartition(partition_id id)
|
KDiskDeviceManager::FindPartition(partition_id id)
|
||||||
{
|
{
|
||||||
PartitionMap::Iterator it = fPartitions->Find(id);
|
PartitionMap::Iterator iterator = fPartitions->Find(id);
|
||||||
if (it != fPartitions->End())
|
if (iterator != fPartitions->End())
|
||||||
return it->Value();
|
return iterator->Value();
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FindFileDevice
|
|
||||||
KFileDiskDevice*
|
KFileDiskDevice*
|
||||||
KDiskDeviceManager::FindFileDevice(const char* filePath)
|
KDiskDeviceManager::FindFileDevice(const char* filePath)
|
||||||
{
|
{
|
||||||
@@ -480,7 +475,7 @@ KDiskDeviceManager::RegisterPartition(partition_id id)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterFileDevice
|
|
||||||
KFileDiskDevice*
|
KFileDiskDevice*
|
||||||
KDiskDeviceManager::RegisterFileDevice(const char* filePath)
|
KDiskDeviceManager::RegisterFileDevice(const char* filePath)
|
||||||
{
|
{
|
||||||
@@ -493,7 +488,7 @@ KDiskDeviceManager::RegisterFileDevice(const char *filePath)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadLockDevice
|
|
||||||
KDiskDevice*
|
KDiskDevice*
|
||||||
KDiskDeviceManager::ReadLockDevice(partition_id id, bool deviceOnly)
|
KDiskDeviceManager::ReadLockDevice(partition_id id, bool deviceOnly)
|
||||||
{
|
{
|
||||||
@@ -508,7 +503,7 @@ KDiskDeviceManager::ReadLockDevice(partition_id id, bool deviceOnly)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteLockDevice
|
|
||||||
KDiskDevice*
|
KDiskDevice*
|
||||||
KDiskDeviceManager::WriteLockDevice(partition_id id, bool deviceOnly)
|
KDiskDeviceManager::WriteLockDevice(partition_id id, bool deviceOnly)
|
||||||
{
|
{
|
||||||
@@ -523,7 +518,7 @@ KDiskDeviceManager::WriteLockDevice(partition_id id, bool deviceOnly)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadLockPartition
|
|
||||||
KPartition*
|
KPartition*
|
||||||
KDiskDeviceManager::ReadLockPartition(partition_id id)
|
KDiskDeviceManager::ReadLockPartition(partition_id id)
|
||||||
{
|
{
|
||||||
@@ -552,7 +547,7 @@ KDiskDeviceManager::ReadLockPartition(partition_id id)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteLockPartition
|
|
||||||
KPartition*
|
KPartition*
|
||||||
KDiskDeviceManager::WriteLockPartition(partition_id id)
|
KDiskDeviceManager::WriteLockPartition(partition_id id)
|
||||||
{
|
{
|
||||||
@@ -582,7 +577,6 @@ KDiskDeviceManager::WriteLockPartition(partition_id id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ScanPartition
|
|
||||||
status_t
|
status_t
|
||||||
KDiskDeviceManager::ScanPartition(KPartition* partition)
|
KDiskDeviceManager::ScanPartition(KPartition* partition)
|
||||||
{
|
{
|
||||||
@@ -671,7 +665,6 @@ KDiskDeviceManager::DeleteDevice(const char *path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// CreateFileDevice
|
|
||||||
partition_id
|
partition_id
|
||||||
KDiskDeviceManager::CreateFileDevice(const char* filePath, bool* newlyCreated)
|
KDiskDeviceManager::CreateFileDevice(const char* filePath, bool* newlyCreated)
|
||||||
{
|
{
|
||||||
@@ -729,7 +722,7 @@ KDiskDeviceManager::CreateFileDevice(const char *filePath, bool* newlyCreated)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteFileDevice
|
|
||||||
status_t
|
status_t
|
||||||
KDiskDeviceManager::DeleteFileDevice(const char* filePath)
|
KDiskDeviceManager::DeleteFileDevice(const char* filePath)
|
||||||
{
|
{
|
||||||
@@ -743,7 +736,7 @@ KDiskDeviceManager::DeleteFileDevice(const char *filePath)
|
|||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteFileDevice
|
|
||||||
status_t
|
status_t
|
||||||
KDiskDeviceManager::DeleteFileDevice(partition_id id)
|
KDiskDeviceManager::DeleteFileDevice(partition_id id)
|
||||||
{
|
{
|
||||||
@@ -759,14 +752,14 @@ KDiskDeviceManager::DeleteFileDevice(partition_id id)
|
|||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// CountDevices
|
|
||||||
int32
|
int32
|
||||||
KDiskDeviceManager::CountDevices()
|
KDiskDeviceManager::CountDevices()
|
||||||
{
|
{
|
||||||
return fDevices->Count();
|
return fDevices->Count();
|
||||||
}
|
}
|
||||||
|
|
||||||
// NextDevice
|
|
||||||
KDiskDevice*
|
KDiskDevice*
|
||||||
KDiskDeviceManager::NextDevice(int32* cookie)
|
KDiskDeviceManager::NextDevice(int32* cookie)
|
||||||
{
|
{
|
||||||
@@ -781,14 +774,14 @@ KDiskDeviceManager::NextDevice(int32 *cookie)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// PartitionAdded
|
|
||||||
bool
|
bool
|
||||||
KDiskDeviceManager::PartitionAdded(KPartition* partition)
|
KDiskDeviceManager::PartitionAdded(KPartition* partition)
|
||||||
{
|
{
|
||||||
return (partition && fPartitions->Put(partition->ID(), partition) == B_OK);
|
return partition && fPartitions->Put(partition->ID(), partition) == B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// PartitionRemoved
|
|
||||||
bool
|
bool
|
||||||
KDiskDeviceManager::PartitionRemoved(KPartition* partition)
|
KDiskDeviceManager::PartitionRemoved(KPartition* partition)
|
||||||
{
|
{
|
||||||
@@ -803,7 +796,7 @@ KDiskDeviceManager::PartitionRemoved(KPartition *partition)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeletePartition
|
|
||||||
bool
|
bool
|
||||||
KDiskDeviceManager::DeletePartition(KPartition* partition)
|
KDiskDeviceManager::DeletePartition(KPartition* partition)
|
||||||
{
|
{
|
||||||
@@ -818,7 +811,6 @@ KDiskDeviceManager::DeletePartition(KPartition *partition)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// FindDiskSystem
|
|
||||||
KDiskSystem*
|
KDiskSystem*
|
||||||
KDiskDeviceManager::FindDiskSystem(const char* name, bool byPrettyName)
|
KDiskDeviceManager::FindDiskSystem(const char* name, bool byPrettyName)
|
||||||
{
|
{
|
||||||
@@ -834,7 +826,7 @@ KDiskDeviceManager::FindDiskSystem(const char *name, bool byPrettyName)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FindDiskSystem
|
|
||||||
KDiskSystem*
|
KDiskSystem*
|
||||||
KDiskDeviceManager::FindDiskSystem(disk_system_id id)
|
KDiskDeviceManager::FindDiskSystem(disk_system_id id)
|
||||||
{
|
{
|
||||||
@@ -844,19 +836,20 @@ KDiskDeviceManager::FindDiskSystem(disk_system_id id)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// CountDiskSystems
|
|
||||||
int32
|
int32
|
||||||
KDiskDeviceManager::CountDiskSystems()
|
KDiskDeviceManager::CountDiskSystems()
|
||||||
{
|
{
|
||||||
return fDiskSystems->Count();
|
return fDiskSystems->Count();
|
||||||
}
|
}
|
||||||
|
|
||||||
// NextDiskSystem
|
|
||||||
KDiskSystem*
|
KDiskSystem*
|
||||||
KDiskDeviceManager::NextDiskSystem(int32* cookie)
|
KDiskDeviceManager::NextDiskSystem(int32* cookie)
|
||||||
{
|
{
|
||||||
if (!cookie)
|
if (!cookie)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
DiskSystemMap::Iterator it = fDiskSystems->FindClose(*cookie, false);
|
DiskSystemMap::Iterator it = fDiskSystems->FindClose(*cookie, false);
|
||||||
if (it != fDiskSystems->End()) {
|
if (it != fDiskSystems->End()) {
|
||||||
KDiskSystem* diskSystem = it->Value();
|
KDiskSystem* diskSystem = it->Value();
|
||||||
@@ -866,7 +859,7 @@ KDiskDeviceManager::NextDiskSystem(int32 *cookie)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadDiskSystem
|
|
||||||
KDiskSystem*
|
KDiskSystem*
|
||||||
KDiskDeviceManager::LoadDiskSystem(const char* name, bool byPrettyName)
|
KDiskDeviceManager::LoadDiskSystem(const char* name, bool byPrettyName)
|
||||||
{
|
{
|
||||||
@@ -879,7 +872,7 @@ KDiskDeviceManager::LoadDiskSystem(const char *name, bool byPrettyName)
|
|||||||
return diskSystem;
|
return diskSystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadDiskSystem
|
|
||||||
KDiskSystem*
|
KDiskSystem*
|
||||||
KDiskDeviceManager::LoadDiskSystem(disk_system_id id)
|
KDiskDeviceManager::LoadDiskSystem(disk_system_id id)
|
||||||
{
|
{
|
||||||
@@ -892,12 +885,13 @@ KDiskDeviceManager::LoadDiskSystem(disk_system_id id)
|
|||||||
return diskSystem;
|
return diskSystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadNextDiskSystem
|
|
||||||
KDiskSystem*
|
KDiskSystem*
|
||||||
KDiskDeviceManager::LoadNextDiskSystem(int32* cookie)
|
KDiskDeviceManager::LoadNextDiskSystem(int32* cookie)
|
||||||
{
|
{
|
||||||
if (!cookie)
|
if (!cookie)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (ManagerLocker locker = this) {
|
if (ManagerLocker locker = this) {
|
||||||
if (KDiskSystem* diskSystem = NextDiskSystem(cookie)) {
|
if (KDiskSystem* diskSystem = NextDiskSystem(cookie)) {
|
||||||
if (diskSystem->Load() == B_OK) {
|
if (diskSystem->Load() == B_OK) {
|
||||||
@@ -909,7 +903,7 @@ KDiskDeviceManager::LoadNextDiskSystem(int32 *cookie)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// InitialDeviceScan
|
|
||||||
status_t
|
status_t
|
||||||
KDiskDeviceManager::InitialDeviceScan()
|
KDiskDeviceManager::InitialDeviceScan()
|
||||||
{
|
{
|
||||||
@@ -1035,19 +1029,20 @@ KDiskDeviceManager::RescanDiskSystems()
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// _AddPartitioningSystem
|
|
||||||
status_t
|
status_t
|
||||||
KDiskDeviceManager::_AddPartitioningSystem(const char* name)
|
KDiskDeviceManager::_AddPartitioningSystem(const char* name)
|
||||||
{
|
{
|
||||||
if (!name)
|
if (!name)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
KDiskSystem* diskSystem = new(nothrow) KPartitioningSystem(name);
|
KDiskSystem* diskSystem = new(nothrow) KPartitioningSystem(name);
|
||||||
if (!diskSystem)
|
if (!diskSystem)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
return _AddDiskSystem(diskSystem);
|
return _AddDiskSystem(diskSystem);
|
||||||
}
|
}
|
||||||
|
|
||||||
// _AddFileSystem
|
|
||||||
status_t
|
status_t
|
||||||
KDiskDeviceManager::_AddFileSystem(const char* name)
|
KDiskDeviceManager::_AddFileSystem(const char* name)
|
||||||
{
|
{
|
||||||
@@ -1061,7 +1056,7 @@ KDiskDeviceManager::_AddFileSystem(const char *name)
|
|||||||
return _AddDiskSystem(diskSystem);
|
return _AddDiskSystem(diskSystem);
|
||||||
}
|
}
|
||||||
|
|
||||||
// _AddDiskSystem
|
|
||||||
status_t
|
status_t
|
||||||
KDiskDeviceManager::_AddDiskSystem(KDiskSystem* diskSystem)
|
KDiskDeviceManager::_AddDiskSystem(KDiskSystem* diskSystem)
|
||||||
{
|
{
|
||||||
@@ -1080,7 +1075,7 @@ KDiskDeviceManager::_AddDiskSystem(KDiskSystem *diskSystem)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
// _AddDevice
|
|
||||||
bool
|
bool
|
||||||
KDiskDeviceManager::_AddDevice(KDiskDevice* device)
|
KDiskDeviceManager::_AddDevice(KDiskDevice* device)
|
||||||
{
|
{
|
||||||
@@ -1092,7 +1087,7 @@ KDiskDeviceManager::_AddDevice(KDiskDevice *device)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// _RemoveDevice
|
|
||||||
bool
|
bool
|
||||||
KDiskDeviceManager::_RemoveDevice(KDiskDevice* device)
|
KDiskDeviceManager::_RemoveDevice(KDiskDevice* device)
|
||||||
{
|
{
|
||||||
@@ -1102,7 +1097,6 @@ KDiskDeviceManager::_RemoveDevice(KDiskDevice *device)
|
|||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// _UpdateBusyPartitions
|
|
||||||
/*!
|
/*!
|
||||||
The device must be write locked, the manager must be locked.
|
The device must be write locked, the manager must be locked.
|
||||||
*/
|
*/
|
||||||
@@ -1166,7 +1160,6 @@ KDiskDeviceManager::_UpdateBusyPartitions(KDiskDevice *device)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// _Scan
|
|
||||||
status_t
|
status_t
|
||||||
KDiskDeviceManager::_Scan(const char* path)
|
KDiskDeviceManager::_Scan(const char* path)
|
||||||
{
|
{
|
||||||
@@ -1211,6 +1204,7 @@ KDiskDeviceManager::_Scan(const char *path)
|
|||||||
KDiskDevice* device = new(nothrow) KDiskDevice;
|
KDiskDevice* device = new(nothrow) KDiskDevice;
|
||||||
if (!device)
|
if (!device)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
// init the KDiskDevice
|
// init the KDiskDevice
|
||||||
error = device->SetTo(path);
|
error = device->SetTo(path);
|
||||||
// add the device
|
// add the device
|
||||||
@@ -1223,7 +1217,7 @@ KDiskDeviceManager::_Scan(const char *path)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
// _ScanPartition
|
|
||||||
/*!
|
/*!
|
||||||
The device must be write locked, the manager must be locked.
|
The device must be write locked, the manager must be locked.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user