Implemented all read-only (more precisely: not writing) methods. Small changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4029 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a1cd43f854
commit
2a596c013a
@ -71,15 +71,15 @@ public:
|
||||
virtual bool IsSubSystemFor(KPartition *partition);
|
||||
|
||||
virtual bool ValidateResize(KPartition *partition, off_t *size);
|
||||
virtual bool ValidateResizeChild(KPartition *partition, off_t *size);
|
||||
virtual bool ValidateResizeChild(KPartition *child, off_t *size);
|
||||
virtual bool ValidateMove(KPartition *partition, off_t *start);
|
||||
virtual bool ValidateMoveChild(KPartition *partition, off_t *start);
|
||||
virtual bool ValidateMoveChild(KPartition *child, off_t *start);
|
||||
virtual bool ValidateSetName(KPartition *partition, char *name);
|
||||
virtual bool ValidateSetContentName(KPartition *partition, char *name);
|
||||
virtual bool ValidateSetType(KPartition *partition, const char *type);
|
||||
virtual bool ValidateSetParameters(KPartition *partition,
|
||||
const char *parameters);
|
||||
virtual bool ValidateSetContentParameters(KPartition *child,
|
||||
virtual bool ValidateSetContentParameters(KPartition *parameters,
|
||||
const char *parameters);
|
||||
virtual bool ValidateInitialize(KPartition *partition, char *name,
|
||||
const char *parameters);
|
||||
@ -87,10 +87,10 @@ public:
|
||||
off_t *size, const char *type,
|
||||
const char *parameters);
|
||||
virtual int32 CountPartitionableSpaces(KPartition *partition);
|
||||
virtual bool GetPartitionableSpaces(KPartition *partition,
|
||||
partitionable_space_data *spaces,
|
||||
int32 count,
|
||||
int32 *actualCount = NULL);
|
||||
virtual status_t GetPartitionableSpaces(KPartition *partition,
|
||||
partitionable_space_data *buffer,
|
||||
int32 count,
|
||||
int32 *actualCount = NULL);
|
||||
|
||||
virtual status_t GetNextSupportedType(KPartition *partition, int32 *cookie,
|
||||
char *type);
|
||||
|
@ -40,12 +40,11 @@ public:
|
||||
virtual bool SupportsSettingContentParameters(KPartition *partition,
|
||||
bool *whileMounted);
|
||||
virtual bool SupportsInitializing(KPartition *partition);
|
||||
virtual bool IsSubSystemFor(KPartition *partition);
|
||||
|
||||
virtual bool ValidateResize(KPartition *partition, off_t *size);
|
||||
virtual bool ValidateMove(KPartition *partition, off_t *start);
|
||||
virtual bool ValidateSetContentName(KPartition *partition, char *name);
|
||||
virtual bool ValidateSetContentParameters(KPartition *child,
|
||||
virtual bool ValidateSetContentParameters(KPartition *partition,
|
||||
const char *parameters);
|
||||
virtual bool ValidateInitialize(KPartition *partition, char *name,
|
||||
const char *parameters);
|
||||
|
@ -48,15 +48,15 @@ public:
|
||||
virtual bool IsSubSystemFor(KPartition *partition);
|
||||
|
||||
virtual bool ValidateResize(KPartition *partition, off_t *size);
|
||||
virtual bool ValidateResizeChild(KPartition *partition, off_t *size);
|
||||
virtual bool ValidateResizeChild(KPartition *child, off_t *size);
|
||||
virtual bool ValidateMove(KPartition *partition, off_t *start);
|
||||
virtual bool ValidateMoveChild(KPartition *partition, off_t *start);
|
||||
virtual bool ValidateMoveChild(KPartition *child, off_t *start);
|
||||
virtual bool ValidateSetName(KPartition *partition, char *name);
|
||||
virtual bool ValidateSetContentName(KPartition *partition, char *name);
|
||||
virtual bool ValidateSetType(KPartition *partition, const char *type);
|
||||
virtual bool ValidateSetParameters(KPartition *partition,
|
||||
const char *parameters);
|
||||
virtual bool ValidateSetContentParameters(KPartition *child,
|
||||
virtual bool ValidateSetContentParameters(KPartition *parameters,
|
||||
const char *parameters);
|
||||
virtual bool ValidateInitialize(KPartition *partition, char *name,
|
||||
const char *parameters);
|
||||
@ -64,10 +64,10 @@ public:
|
||||
off_t *size, const char *type,
|
||||
const char *parameters);
|
||||
virtual int32 CountPartitionableSpaces(KPartition *partition);
|
||||
virtual bool GetPartitionableSpaces(KPartition *partition,
|
||||
partitionable_space_data *spaces,
|
||||
int32 count,
|
||||
int32 *actualCount = NULL);
|
||||
virtual status_t GetPartitionableSpaces(KPartition *partition,
|
||||
partitionable_space_data *buffer,
|
||||
int32 count,
|
||||
int32 *actualCount = NULL);
|
||||
|
||||
virtual status_t GetNextSupportedType(KPartition *partition, int32 *cookie,
|
||||
char *type);
|
||||
|
@ -312,7 +312,7 @@ KDiskSystem::ValidateResize(KPartition *partition, off_t *size)
|
||||
|
||||
// ValidateResizeChild
|
||||
bool
|
||||
KDiskSystem::ValidateResizeChild(KPartition *partition, off_t *size)
|
||||
KDiskSystem::ValidateResizeChild(KPartition *child, off_t *size)
|
||||
{
|
||||
// to be implemented by derived classes
|
||||
return false;
|
||||
@ -328,7 +328,7 @@ KDiskSystem::ValidateMove(KPartition *partition, off_t *start)
|
||||
|
||||
// ValidateMoveChild
|
||||
bool
|
||||
KDiskSystem::ValidateMoveChild(KPartition *partition, off_t *start)
|
||||
KDiskSystem::ValidateMoveChild(KPartition *child, off_t *start)
|
||||
{
|
||||
// to be implemented by derived classes
|
||||
return false;
|
||||
@ -369,7 +369,7 @@ KDiskSystem::ValidateSetParameters(KPartition *partition,
|
||||
|
||||
// ValidateSetContentParameters
|
||||
bool
|
||||
KDiskSystem::ValidateSetContentParameters(KPartition *child,
|
||||
KDiskSystem::ValidateSetContentParameters(KPartition *partition,
|
||||
const char *parameters)
|
||||
{
|
||||
// to be implemented by derived classes
|
||||
@ -404,13 +404,13 @@ KDiskSystem::CountPartitionableSpaces(KPartition *partition)
|
||||
}
|
||||
|
||||
// GetPartitionableSpaces
|
||||
bool
|
||||
status_t
|
||||
KDiskSystem::GetPartitionableSpaces(KPartition *partition,
|
||||
partitionable_space_data *spaces,
|
||||
partitionable_space_data *buffer,
|
||||
int32 count, int32 *actualCount)
|
||||
{
|
||||
// to be implemented by derived classes
|
||||
return false;
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
// GetNextSupportedType
|
||||
|
@ -90,10 +90,15 @@ KFileSystem::FreeContentCookie(KPartition *partition)
|
||||
bool
|
||||
KFileSystem::SupportsDefragmenting(KPartition *partition, bool *whileMounted)
|
||||
{
|
||||
// to be implemented
|
||||
if (whileMounted)
|
||||
*whileMounted = false;
|
||||
return false;
|
||||
bool _whileMounted = false;
|
||||
if (!whileMounted)
|
||||
whileMounted = &_whileMounted;
|
||||
if (!partition || partition->DiskSystem() != this || !fModule
|
||||
|| !fModule->supports_defragmenting) {
|
||||
return (*whileMounted = false);
|
||||
}
|
||||
return fModule->supports_defragmenting(partition->PartitionData(),
|
||||
whileMounted);
|
||||
}
|
||||
|
||||
// SupportsRepairing
|
||||
@ -101,30 +106,44 @@ bool
|
||||
KFileSystem::SupportsRepairing(KPartition *partition, bool checkOnly,
|
||||
bool *whileMounted)
|
||||
{
|
||||
// to be implemented
|
||||
if (whileMounted)
|
||||
*whileMounted = false;
|
||||
return false;
|
||||
bool _whileMounted = false;
|
||||
if (!whileMounted)
|
||||
whileMounted = &_whileMounted;
|
||||
if (!partition || partition->DiskSystem() != this || !fModule
|
||||
|| !fModule->supports_repairing) {
|
||||
return (*whileMounted = false);
|
||||
}
|
||||
return fModule->supports_repairing(partition->PartitionData(), checkOnly,
|
||||
whileMounted);
|
||||
}
|
||||
|
||||
// SupportsResizing
|
||||
bool
|
||||
KFileSystem::SupportsResizing(KPartition *partition, bool *whileMounted)
|
||||
{
|
||||
// to be implemented
|
||||
if (whileMounted)
|
||||
*whileMounted = false;
|
||||
return false;
|
||||
bool _whileMounted = false;
|
||||
if (!whileMounted)
|
||||
whileMounted = &_whileMounted;
|
||||
if (!partition || partition->DiskSystem() != this || !fModule
|
||||
|| !fModule->supports_resizing) {
|
||||
return (*whileMounted = false);
|
||||
}
|
||||
return fModule->supports_resizing(partition->PartitionData(),
|
||||
whileMounted);
|
||||
}
|
||||
|
||||
// SupportsMoving
|
||||
bool
|
||||
KFileSystem::SupportsMoving(KPartition *partition, bool *isNoOp)
|
||||
{
|
||||
// to be implemented
|
||||
if (isNoOp)
|
||||
*isNoOp = false;
|
||||
return false;
|
||||
bool _isNoOp = false;
|
||||
if (!isNoOp)
|
||||
isNoOp = &_isNoOp;
|
||||
if (!partition || partition->DiskSystem() != this || !fModule
|
||||
|| !fModule->supports_moving) {
|
||||
return (*isNoOp = false);
|
||||
}
|
||||
return fModule->supports_moving(partition->PartitionData(), isNoOp);
|
||||
}
|
||||
|
||||
// SupportsSettingContentName
|
||||
@ -132,8 +151,15 @@ bool
|
||||
KFileSystem::SupportsSettingContentName(KPartition *partition,
|
||||
bool *whileMounted)
|
||||
{
|
||||
// to be implemented
|
||||
return false;
|
||||
bool _whileMounted = false;
|
||||
if (!whileMounted)
|
||||
whileMounted = &_whileMounted;
|
||||
if (!partition || partition->DiskSystem() != this || !fModule
|
||||
|| !fModule->supports_setting_content_name) {
|
||||
return (*whileMounted = false);
|
||||
}
|
||||
return fModule->supports_setting_content_name(partition->PartitionData(),
|
||||
whileMounted);
|
||||
}
|
||||
|
||||
// SupportsSettingContentParameters
|
||||
@ -141,57 +167,62 @@ bool
|
||||
KFileSystem::SupportsSettingContentParameters(KPartition *partition,
|
||||
bool *whileMounted)
|
||||
{
|
||||
// to be implemented
|
||||
return false;
|
||||
bool _whileMounted = false;
|
||||
if (!whileMounted)
|
||||
whileMounted = &_whileMounted;
|
||||
if (!partition || partition->DiskSystem() != this || !fModule
|
||||
|| !fModule->supports_setting_content_parameters) {
|
||||
return (*whileMounted = false);
|
||||
}
|
||||
return fModule->supports_setting_content_parameters(
|
||||
partition->PartitionData(), whileMounted);
|
||||
}
|
||||
|
||||
// SupportsInitializing
|
||||
bool
|
||||
KFileSystem::SupportsInitializing(KPartition *partition)
|
||||
{
|
||||
// to be implemented
|
||||
return false;
|
||||
}
|
||||
|
||||
// IsSubSystemFor
|
||||
bool
|
||||
KFileSystem::IsSubSystemFor(KPartition *partition)
|
||||
{
|
||||
// to be implemented
|
||||
return false;
|
||||
return (partition && fModule && fModule->supports_initializing
|
||||
&& fModule->supports_initializing(partition->PartitionData()));
|
||||
}
|
||||
|
||||
// ValidateResize
|
||||
bool
|
||||
KFileSystem::ValidateResize(KPartition *partition, off_t *size)
|
||||
{
|
||||
// to be implemented
|
||||
return false;
|
||||
return (partition && size && partition->DiskSystem() == this && fModule
|
||||
&& fModule->validate_resize
|
||||
&& fModule->validate_resize(partition->PartitionData(), size));
|
||||
}
|
||||
|
||||
// ValidateMove
|
||||
bool
|
||||
KFileSystem::ValidateMove(KPartition *partition, off_t *start)
|
||||
{
|
||||
// to be implemented
|
||||
return false;
|
||||
return (partition && start && partition->DiskSystem() == this && fModule
|
||||
&& fModule->validate_move
|
||||
&& fModule->validate_move(partition->PartitionData(), start));
|
||||
}
|
||||
|
||||
// ValidateSetContentName
|
||||
bool
|
||||
KFileSystem::ValidateSetContentName(KPartition *partition, char *name)
|
||||
{
|
||||
// to be implemented
|
||||
return false;
|
||||
return (partition && name && partition->DiskSystem() == this
|
||||
&& fModule && fModule->validate_set_content_name
|
||||
&& fModule->validate_set_content_name(partition->PartitionData(),
|
||||
name));
|
||||
}
|
||||
|
||||
// ValidateSetContentParameters
|
||||
bool
|
||||
KFileSystem::ValidateSetContentParameters(KPartition *child,
|
||||
KFileSystem::ValidateSetContentParameters(KPartition *partition,
|
||||
const char *parameters)
|
||||
{
|
||||
// to be implemented
|
||||
return false;
|
||||
return (partition && partition->DiskSystem() == this && fModule
|
||||
&& fModule->validate_set_content_parameters
|
||||
&& fModule->validate_set_content_parameters(
|
||||
partition->PartitionData(), parameters));
|
||||
}
|
||||
|
||||
// ValidateInitialize
|
||||
@ -199,8 +230,9 @@ bool
|
||||
KFileSystem::ValidateInitialize(KPartition *partition, char *name,
|
||||
const char *parameters)
|
||||
{
|
||||
// to be implemented
|
||||
return false;
|
||||
return (partition && name && fModule && fModule->validate_initialize
|
||||
&& fModule->validate_initialize(partition->PartitionData(), name,
|
||||
parameters));
|
||||
}
|
||||
|
||||
// Defragment
|
||||
|
@ -113,6 +113,10 @@ KPartition::PrepareForRemoval()
|
||||
{
|
||||
bool result = RemoveAllChildren();
|
||||
UnpublishDevice();
|
||||
if (ParentDiskSystem())
|
||||
ParentDiskSystem()->FreeCookie(this);
|
||||
if (DiskSystem())
|
||||
DiskSystem()->FreeContentCookie(this);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user