Added ValidateInitialize() and a _SetTo(disk_system_id). Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4001 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a1a7d37e2c
commit
38844d14f8
@ -40,14 +40,6 @@ public:
|
||||
bool SupportsInitializingChild(BPartition *child,
|
||||
const char *diskSystem) const;
|
||||
|
||||
bool SupportsParentSystem(BPartition *child) const;
|
||||
bool SupportsParentSystem(const char *system) const;
|
||||
// True in most cases. NULL == raw device.
|
||||
bool SupportsChildSystem(BPartition *child, const char *system) const;
|
||||
bool SupportsChildSystem(const char *system) const;
|
||||
// False for most file systems, true for most partitioning
|
||||
// systems.
|
||||
|
||||
status_t ValidateResize(BPartition *partition, off_t *size) const;
|
||||
status_t ValidateResizeChild(BPartition *child, off_t *size) const;
|
||||
status_t ValidateMove(BPartition *partition, off_t *start) const;
|
||||
@ -58,6 +50,8 @@ public:
|
||||
status_t ValidateCreateChild(BPartition *partition, off_t *start,
|
||||
off_t *size, const char *type,
|
||||
const char *parameters) const;
|
||||
status_t ValidateInitialize(BPartition *partition, char *name,
|
||||
const char *parameters) const;
|
||||
|
||||
status_t GetNextSupportedType(BPartition *partition, int32 *cookie,
|
||||
char *type) const;
|
||||
@ -70,10 +64,12 @@ public:
|
||||
bool IsSubSystemFor(BPartition *parent) const;
|
||||
|
||||
private:
|
||||
status_t _SetTo(disk_system_id id);
|
||||
status_t _SetTo(user_disk_system_info *info);
|
||||
void _Unset();
|
||||
|
||||
friend class BDiskDeviceRoster;
|
||||
friend class BPartition;
|
||||
|
||||
disk_system_id fID;
|
||||
BString fName;
|
||||
|
@ -301,6 +301,20 @@ BDiskSystem::ValidateCreateChild(BPartition *partition, off_t *start,
|
||||
start, size, type, parameters);
|
||||
}
|
||||
|
||||
// ValidateInitialize
|
||||
status_t
|
||||
BDiskSystem::ValidateInitialize(BPartition *partition, char *name,
|
||||
const char *parameters) const
|
||||
{
|
||||
if (InitCheck() != B_OK)
|
||||
return InitCheck();
|
||||
// parameters may be NULL
|
||||
if (!name || !partition || !partition->_IsShadow())
|
||||
return B_BAD_VALUE;
|
||||
return _kern_validate_initialize_partition(fID, partition->_ShadowID(),
|
||||
name, parameters);
|
||||
}
|
||||
|
||||
// GetNextSupportedType
|
||||
status_t
|
||||
BDiskSystem::GetNextSupportedType(BPartition *partition, int32 *cookie,
|
||||
@ -351,6 +365,20 @@ BDiskSystem::IsSubSystemFor(BPartition *parent) const
|
||||
&& _kern_is_sub_disk_system_for(fID, parent->_ShadowID()));
|
||||
}
|
||||
|
||||
// _SetTo
|
||||
status_t
|
||||
BDiskSystem::_SetTo(disk_system_id id)
|
||||
{
|
||||
_Unset();
|
||||
if (id < 0)
|
||||
return fID;
|
||||
user_disk_system_info info;
|
||||
status_t error = _kern_get_disk_system_info(id, &info);
|
||||
if (error != B_OK)
|
||||
return (fID = error);
|
||||
return _SetTo(&info);
|
||||
}
|
||||
|
||||
// _SetTo
|
||||
status_t
|
||||
BDiskSystem::_SetTo(user_disk_system_info *info)
|
||||
|
Loading…
x
Reference in New Issue
Block a user