* Removed the Validate*() methods. They are less useful than their
BPartition counterparts. * Removed the BPartition* argument from the Supports*() methods. They now return only general capability information. The BPartition::Can*() methods would be used to learn whether a certain operation is possible with the partition. * Added some missing Supports*() methods. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4010 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -22,36 +22,20 @@ public:
|
|||||||
const char *Name() const;
|
const char *Name() const;
|
||||||
const char *PrettyName() const;
|
const char *PrettyName() const;
|
||||||
|
|
||||||
bool SupportsDefragmenting(BPartition *partition,
|
bool SupportsDefragmenting(bool *whileMounted) const;
|
||||||
bool *whileMounted) const;
|
bool SupportsRepairing(bool checkOnly, bool *whileMounted) const;
|
||||||
bool SupportsRepairing(BPartition *partition, bool checkOnly,
|
bool SupportsResizing(bool *whileMounted) const;
|
||||||
bool *whileMounted) const;
|
bool SupportsResizingChild() const;
|
||||||
bool SupportsResizing(BPartition *partition, bool *whileMounted) const;
|
bool SupportsMoving(bool *whileMounted) const;
|
||||||
bool SupportsResizingChild(BPartition *child) const;
|
bool SupportsMovingChild() const;
|
||||||
bool SupportsMoving(BPartition *partition, bool *whileMounted) const;
|
bool SupportsSettingName() const;
|
||||||
bool SupportsMovingChild(BPartition *child) const;
|
bool SupportsSettingContentName(bool *whileMounted) const;
|
||||||
bool SupportsSettingName(BPartition *partition) const;
|
bool SupportsSettingType() const;
|
||||||
bool SupportsSettingContentName(BPartition *partition,
|
bool SupportsSettingParameters() const;
|
||||||
bool *whileMounted) const;
|
bool SupportsSettingContentParameters(bool *whileMounted) const;
|
||||||
bool SupportsSettingType(BPartition *partition) const;
|
bool SupportsCreatingChild() const;
|
||||||
bool SupportsCreatingChild(BPartition *partition) const;
|
bool SupportsDeletingChild() const;
|
||||||
bool SupportsDeletingChild(BPartition *child) const;
|
bool SupportsInitializing() const;
|
||||||
bool SupportsInitializing(BPartition *partition) const;
|
|
||||||
bool SupportsInitializingChild(BPartition *child,
|
|
||||||
const char *diskSystem) const;
|
|
||||||
|
|
||||||
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;
|
|
||||||
status_t ValidateMoveChild(BPartition *child, off_t *start) const;
|
|
||||||
status_t ValidateSetName(BPartition *partition, char *name) const;
|
|
||||||
status_t ValidateSetContentName(BPartition *partition, char *name) const;
|
|
||||||
status_t ValidateSetType(BPartition *partition, const char *type) const;
|
|
||||||
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,
|
status_t GetNextSupportedType(BPartition *partition, int32 *cookie,
|
||||||
char *type) const;
|
char *type) const;
|
||||||
@@ -74,7 +58,7 @@ private:
|
|||||||
disk_system_id fID;
|
disk_system_id fID;
|
||||||
BString fName;
|
BString fName;
|
||||||
BString fPrettyName;
|
BString fPrettyName;
|
||||||
bool fFileSystem;
|
uint32 fFlags;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _DISK_SYSTEM_H
|
#endif // _DISK_SYSTEM_H
|
||||||
|
|||||||
+109
-211
@@ -12,7 +12,7 @@ BDiskSystem::BDiskSystem()
|
|||||||
: fID(B_NO_INIT),
|
: fID(B_NO_INIT),
|
||||||
fName(),
|
fName(),
|
||||||
fPrettyName(),
|
fPrettyName(),
|
||||||
fFileSystem(false)
|
fFlags(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,275 +44,173 @@ BDiskSystem::PrettyName() const
|
|||||||
|
|
||||||
// SupportsDefragmenting
|
// SupportsDefragmenting
|
||||||
bool
|
bool
|
||||||
BDiskSystem::SupportsDefragmenting(BPartition *partition,
|
BDiskSystem::SupportsDefragmenting(bool *whileMounted) const
|
||||||
bool *whileMounted) const
|
|
||||||
{
|
{
|
||||||
return (InitCheck() == B_OK && IsFileSystem()
|
if (InitCheck() != B_OK
|
||||||
&& partition && partition->_IsShadow()
|
|| !(fFlags & B_DISK_SYSTEM_SUPPORTS_DEFRAGMENTING)) {
|
||||||
&& partition->_DiskSystem() == fID
|
if (whileMounted)
|
||||||
&& _kern_supports_defragmenting_partition(fID,
|
*whileMounted = false;
|
||||||
partition->_ShadowID(), whileMounted));
|
return false;
|
||||||
|
}
|
||||||
|
if (whileMounted) {
|
||||||
|
*whileMounted = (IsFileSystem()
|
||||||
|
&& (fFlags & B_DISK_SYSTEM_SUPPORTS_DEFRAGMENTING_WHILE_MOUNTED));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupportsRepairing
|
// SupportsRepairing
|
||||||
bool
|
bool
|
||||||
BDiskSystem::SupportsRepairing(BPartition *partition, bool checkOnly,
|
BDiskSystem::SupportsRepairing(bool checkOnly, bool *whileMounted) const
|
||||||
bool *whileMounted) const
|
|
||||||
{
|
{
|
||||||
return (InitCheck() == B_OK
|
uint32 mainBit = B_DISK_SYSTEM_SUPPORTS_REPAIRING;
|
||||||
&& partition && partition->_IsShadow()
|
uint32 mountedBit = B_DISK_SYSTEM_SUPPORTS_REPAIRING_WHILE_MOUNTED;
|
||||||
&& partition->_DiskSystem() == fID
|
if (checkOnly) {
|
||||||
&& _kern_supports_repairing_partition(fID, partition->_ShadowID(),
|
mainBit = B_DISK_SYSTEM_SUPPORTS_CHECKING;
|
||||||
checkOnly, whileMounted));
|
mountedBit = B_DISK_SYSTEM_SUPPORTS_CHECKING_WHILE_MOUNTED;
|
||||||
|
}
|
||||||
|
if (InitCheck() != B_OK || !(fFlags & mainBit)) {
|
||||||
|
if (whileMounted)
|
||||||
|
*whileMounted = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (whileMounted)
|
||||||
|
*whileMounted = (IsFileSystem() && (fFlags & mountedBit));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupportsResizing
|
// SupportsResizing
|
||||||
bool
|
bool
|
||||||
BDiskSystem::SupportsResizing(BPartition *partition, bool *whileMounted) const
|
BDiskSystem::SupportsResizing(bool *whileMounted) const
|
||||||
{
|
{
|
||||||
return (InitCheck() == B_OK
|
if (InitCheck() != B_OK
|
||||||
&& partition && partition->_IsShadow()
|
|| !(fFlags & B_DISK_SYSTEM_SUPPORTS_RESIZING)) {
|
||||||
&& partition->_DiskSystem() == fID
|
if (whileMounted)
|
||||||
&& _kern_supports_resizing_partition(fID, partition->_ShadowID(),
|
*whileMounted = false;
|
||||||
whileMounted));
|
return false;
|
||||||
|
}
|
||||||
|
if (whileMounted) {
|
||||||
|
*whileMounted = (IsFileSystem()
|
||||||
|
&& (fFlags & B_DISK_SYSTEM_SUPPORTS_RESIZING_WHILE_MOUNTED));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupportsResizingChild
|
// SupportsResizingChild
|
||||||
bool
|
bool
|
||||||
BDiskSystem::SupportsResizingChild(BPartition *child) const
|
BDiskSystem::SupportsResizingChild() const
|
||||||
{
|
{
|
||||||
return (InitCheck() == B_OK && IsPartitioningSystem()
|
return (InitCheck() == B_OK && IsPartitioningSystem()
|
||||||
&& child && child->_IsShadow() && child->Parent()
|
&& (fFlags & B_DISK_SYSTEM_SUPPORTS_RESIZING_CHILD));
|
||||||
&& child->Parent()->_DiskSystem() == fID
|
|
||||||
&& _kern_supports_resizing_child_partition(fID,
|
|
||||||
child->_ShadowID()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupportsMoving
|
// SupportsMoving
|
||||||
bool
|
bool
|
||||||
BDiskSystem::SupportsMoving(BPartition *partition, bool *whileMounted) const
|
BDiskSystem::SupportsMoving(bool *whileMounted) const
|
||||||
{
|
{
|
||||||
return (InitCheck() == B_OK
|
if (InitCheck() != B_OK
|
||||||
&& partition && partition->_IsShadow()
|
|| !(fFlags & B_DISK_SYSTEM_SUPPORTS_MOVING)) {
|
||||||
&& partition->_DiskSystem() == fID
|
if (whileMounted)
|
||||||
&& _kern_supports_moving_partition(fID, partition->_ShadowID(),
|
*whileMounted = false;
|
||||||
whileMounted));
|
return false;
|
||||||
|
}
|
||||||
|
if (whileMounted) {
|
||||||
|
*whileMounted = (IsFileSystem()
|
||||||
|
&& (fFlags & B_DISK_SYSTEM_SUPPORTS_MOVING_WHILE_MOUNTED));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupportsMovingChild
|
// SupportsMovingChild
|
||||||
bool
|
bool
|
||||||
BDiskSystem::SupportsMovingChild(BPartition *child) const
|
BDiskSystem::SupportsMovingChild() const
|
||||||
{
|
{
|
||||||
return (InitCheck() == B_OK && IsPartitioningSystem()
|
return (InitCheck() == B_OK && IsPartitioningSystem()
|
||||||
&& child && child->_IsShadow() && child->Parent()
|
&& (fFlags & B_DISK_SYSTEM_SUPPORTS_MOVING_CHILD));
|
||||||
&& child->Parent()->_DiskSystem() == fID
|
|
||||||
&& _kern_supports_moving_child_partition(fID, child->_ShadowID()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupportsSettingName
|
// SupportsSettingName
|
||||||
bool
|
bool
|
||||||
BDiskSystem::SupportsSettingName(BPartition *partition) const
|
BDiskSystem::SupportsSettingName() const
|
||||||
{
|
{
|
||||||
return (InitCheck() == B_OK && IsPartitioningSystem()
|
return (InitCheck() == B_OK && IsPartitioningSystem()
|
||||||
&& partition && partition->_IsShadow() && partition->Parent()
|
&& (fFlags & B_DISK_SYSTEM_SUPPORTS_SETTING_NAME));
|
||||||
&& partition->Parent()->_DiskSystem() == fID
|
|
||||||
&& _kern_supports_setting_partition_name(fID,
|
|
||||||
partition->_ShadowID()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupportsSettingContentName
|
// SupportsSettingContentName
|
||||||
bool
|
bool
|
||||||
BDiskSystem::SupportsSettingContentName(BPartition *partition,
|
BDiskSystem::SupportsSettingContentName(bool *whileMounted) const
|
||||||
bool *whileMounted) const
|
|
||||||
{
|
{
|
||||||
return (InitCheck() == B_OK
|
if (InitCheck() != B_OK
|
||||||
&& partition && partition->_IsShadow()
|
|| !(fFlags & B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_NAME)) {
|
||||||
&& partition->_DiskSystem() == fID
|
if (whileMounted)
|
||||||
&& _kern_supports_setting_partition_content_name(fID,
|
*whileMounted = false;
|
||||||
partition->_ShadowID(), whileMounted));
|
return false;
|
||||||
|
}
|
||||||
|
if (whileMounted) {
|
||||||
|
*whileMounted = (IsFileSystem()
|
||||||
|
&& (fFlags
|
||||||
|
& B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_NAME_WHILE_MOUNTED));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupportsSettingType
|
// SupportsSettingType
|
||||||
bool
|
bool
|
||||||
BDiskSystem::SupportsSettingType(BPartition *partition) const
|
BDiskSystem::SupportsSettingType() const
|
||||||
{
|
{
|
||||||
return (InitCheck() == B_OK && IsPartitioningSystem()
|
return (InitCheck() == B_OK && IsPartitioningSystem()
|
||||||
&& partition && partition->_IsShadow() && partition->Parent()
|
&& (fFlags & B_DISK_SYSTEM_SUPPORTS_SETTING_TYPE));
|
||||||
&& partition->Parent()->_DiskSystem() == fID
|
}
|
||||||
&& _kern_supports_setting_partition_type(fID,
|
|
||||||
partition->_ShadowID()));
|
// SupportsSettingParameters
|
||||||
|
bool
|
||||||
|
BDiskSystem::SupportsSettingParameters() const
|
||||||
|
{
|
||||||
|
return (InitCheck() == B_OK && IsPartitioningSystem()
|
||||||
|
&& (fFlags & B_DISK_SYSTEM_SUPPORTS_SETTING_PARAMETERS));
|
||||||
|
}
|
||||||
|
|
||||||
|
// SupportsSettingContentParameters
|
||||||
|
bool
|
||||||
|
BDiskSystem::SupportsSettingContentParameters(bool *whileMounted) const
|
||||||
|
{
|
||||||
|
if (InitCheck() != B_OK
|
||||||
|
|| !(fFlags & B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_PARAMETERS)) {
|
||||||
|
if (whileMounted)
|
||||||
|
*whileMounted = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (whileMounted) {
|
||||||
|
*whileMounted = (IsFileSystem()
|
||||||
|
&& (fFlags
|
||||||
|
& B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_PARAMETERS_WHILE_MOUNTED));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupportsCreatingChild
|
// SupportsCreatingChild
|
||||||
bool
|
bool
|
||||||
BDiskSystem::SupportsCreatingChild(BPartition *partition) const
|
BDiskSystem::SupportsCreatingChild() const
|
||||||
{
|
{
|
||||||
return (InitCheck() == B_OK && IsPartitioningSystem()
|
return (InitCheck() == B_OK && IsPartitioningSystem()
|
||||||
&& partition && partition->_IsShadow()
|
&& (fFlags & B_DISK_SYSTEM_SUPPORTS_CREATING_CHILD));
|
||||||
&& partition->_DiskSystem() == fID
|
|
||||||
&& _kern_supports_creating_child_partition(fID,
|
|
||||||
partition->_ShadowID()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupportsDeletingChild
|
// SupportsDeletingChild
|
||||||
bool
|
bool
|
||||||
BDiskSystem::SupportsDeletingChild(BPartition *child) const
|
BDiskSystem::SupportsDeletingChild() const
|
||||||
{
|
{
|
||||||
return (InitCheck() == B_OK && IsPartitioningSystem()
|
return (InitCheck() == B_OK && IsPartitioningSystem()
|
||||||
&& child && child->_IsShadow() && child->Parent()
|
&& (fFlags & B_DISK_SYSTEM_SUPPORTS_DELETING_CHILD));
|
||||||
&& child->Parent()->_DiskSystem() == fID
|
|
||||||
&& _kern_supports_deleting_child_partition(fID,
|
|
||||||
child->_ShadowID()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupportsInitializing
|
// SupportsInitializing
|
||||||
bool
|
bool
|
||||||
BDiskSystem::SupportsInitializing(BPartition *partition) const
|
BDiskSystem::SupportsInitializing() const
|
||||||
{
|
{
|
||||||
return (InitCheck() == B_OK
|
return (InitCheck() == B_OK
|
||||||
&& partition && partition->_IsShadow()
|
&& (fFlags & B_DISK_SYSTEM_SUPPORTS_INITIALIZING));
|
||||||
&& _kern_supports_initializing_partition(fID,
|
|
||||||
partition->_ShadowID()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// SupportsInitializingChild
|
|
||||||
bool
|
|
||||||
BDiskSystem::SupportsInitializingChild(BPartition *child,
|
|
||||||
const char *diskSystem) const
|
|
||||||
{
|
|
||||||
return (InitCheck() == B_OK && IsPartitioningSystem() && diskSystem
|
|
||||||
&& child && child->_IsShadow() && child->Parent()
|
|
||||||
&& child->Parent()->_DiskSystem() == fID
|
|
||||||
&& _kern_supports_initializing_child_partition(fID,
|
|
||||||
child->_ShadowID(), diskSystem));
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateResize
|
|
||||||
status_t
|
|
||||||
BDiskSystem::ValidateResize(BPartition *partition, off_t *size) const
|
|
||||||
{
|
|
||||||
if (InitCheck() != B_OK)
|
|
||||||
return InitCheck();
|
|
||||||
if (!size || !partition || !partition->_IsShadow()
|
|
||||||
|| partition->_DiskSystem() != fID) {
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
}
|
|
||||||
return _kern_validate_resize_partition(fID, partition->_ShadowID(), size);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateResizeChild
|
|
||||||
status_t
|
|
||||||
BDiskSystem::ValidateResizeChild(BPartition *child, off_t *size) const
|
|
||||||
{
|
|
||||||
if (InitCheck() != B_OK)
|
|
||||||
return InitCheck();
|
|
||||||
if (!size || !child || !child->_IsShadow() || !child->Parent()
|
|
||||||
|| child->Parent()->_DiskSystem() != fID || !IsPartitioningSystem()) {
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
}
|
|
||||||
return _kern_validate_resize_child_partition(fID, child->_ShadowID(),
|
|
||||||
size);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateMove
|
|
||||||
status_t
|
|
||||||
BDiskSystem::ValidateMove(BPartition *partition, off_t *start) const
|
|
||||||
{
|
|
||||||
if (InitCheck() != B_OK)
|
|
||||||
return InitCheck();
|
|
||||||
if (!start || !partition || !partition->_IsShadow()
|
|
||||||
|| partition->_DiskSystem() != fID) {
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
}
|
|
||||||
return _kern_validate_move_partition(fID, partition->_ShadowID(), start);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateMoveChild
|
|
||||||
status_t
|
|
||||||
BDiskSystem::ValidateMoveChild(BPartition *child, off_t *start) const
|
|
||||||
{
|
|
||||||
if (InitCheck() != B_OK)
|
|
||||||
return InitCheck();
|
|
||||||
if (!start || !child || !child->_IsShadow() || !child->Parent()
|
|
||||||
|| child->Parent()->_DiskSystem() != fID || !IsPartitioningSystem()) {
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
}
|
|
||||||
return _kern_validate_move_child_partition(fID, child->_ShadowID(), start);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateSetName
|
|
||||||
status_t
|
|
||||||
BDiskSystem::ValidateSetName(BPartition *partition, char *name) const
|
|
||||||
{
|
|
||||||
if (InitCheck() != B_OK)
|
|
||||||
return InitCheck();
|
|
||||||
if (!name || !partition || !partition->_IsShadow() || !partition->Parent()
|
|
||||||
|| partition->Parent()->_DiskSystem() != fID
|
|
||||||
|| !IsPartitioningSystem()) {
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
}
|
|
||||||
return _kern_validate_set_partition_name(fID, partition->_ShadowID(),
|
|
||||||
name);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateSetContentName
|
|
||||||
status_t
|
|
||||||
BDiskSystem::ValidateSetContentName(BPartition *partition, char *name) const
|
|
||||||
{
|
|
||||||
if (InitCheck() != B_OK)
|
|
||||||
return InitCheck();
|
|
||||||
if (!name || !partition || !partition->_IsShadow()
|
|
||||||
|| partition->_DiskSystem() != fID) {
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
}
|
|
||||||
return _kern_validate_set_partition_content_name(fID,
|
|
||||||
partition->_ShadowID(), name);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateSetType
|
|
||||||
status_t
|
|
||||||
BDiskSystem::ValidateSetType(BPartition *partition, const char *type) const
|
|
||||||
{
|
|
||||||
if (InitCheck() != B_OK)
|
|
||||||
return InitCheck();
|
|
||||||
if (!type || !partition || !partition->_IsShadow() || !partition->Parent()
|
|
||||||
|| partition->Parent()->_DiskSystem() != fID
|
|
||||||
|| !IsPartitioningSystem()) {
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
}
|
|
||||||
return _kern_validate_set_partition_type(fID, partition->_ShadowID(),
|
|
||||||
type);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateCreateChild
|
|
||||||
status_t
|
|
||||||
BDiskSystem::ValidateCreateChild(BPartition *partition, off_t *start,
|
|
||||||
off_t *size, const char *type,
|
|
||||||
const char *parameters) const
|
|
||||||
{
|
|
||||||
if (InitCheck() != B_OK)
|
|
||||||
return InitCheck();
|
|
||||||
// parameter may be NULL
|
|
||||||
if (!start || !size || !type || !partition || !partition->_IsShadow()
|
|
||||||
|| partition->_DiskSystem() != fID || !IsPartitioningSystem()) {
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
}
|
|
||||||
return _kern_validate_create_child_partition(fID, partition->_ShadowID(),
|
|
||||||
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
|
// GetNextSupportedType
|
||||||
@@ -346,14 +244,14 @@ BDiskSystem::GetTypeForContentType(const char *contentType, char *type) const
|
|||||||
bool
|
bool
|
||||||
BDiskSystem::IsPartitioningSystem() const
|
BDiskSystem::IsPartitioningSystem() const
|
||||||
{
|
{
|
||||||
return (InitCheck() == B_OK && !fFileSystem);
|
return (InitCheck() == B_OK && !(fFlags & B_DISK_SYSTEM_IS_FILE_SYSTEM));
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsFileSystem
|
// IsFileSystem
|
||||||
bool
|
bool
|
||||||
BDiskSystem::IsFileSystem() const
|
BDiskSystem::IsFileSystem() const
|
||||||
{
|
{
|
||||||
return (InitCheck() == B_OK && fFileSystem);
|
return (InitCheck() == B_OK && (fFlags & B_DISK_SYSTEM_IS_FILE_SYSTEM));
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsSubSystemFor
|
// IsSubSystemFor
|
||||||
@@ -389,7 +287,7 @@ BDiskSystem::_SetTo(user_disk_system_info *info)
|
|||||||
fID = info->id;
|
fID = info->id;
|
||||||
fName = info->name;
|
fName = info->name;
|
||||||
fPrettyName = info->pretty_name;
|
fPrettyName = info->pretty_name;
|
||||||
fFileSystem = info->file_system;
|
fFlags = info->flags;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -400,6 +298,6 @@ BDiskSystem::_Unset()
|
|||||||
fID = B_NO_INIT;
|
fID = B_NO_INIT;
|
||||||
fName = (const char*)NULL;
|
fName = (const char*)NULL;
|
||||||
fPrettyName = (const char*)NULL;
|
fPrettyName = (const char*)NULL;
|
||||||
fFileSystem = false;
|
fFlags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user