* Added ShadowPartitionChanged() to KDiskSystem and respective hooks
to the module interfaces. So the disk system will be informed, when a shadow partition has changed and it is allowed to do necessary adjustions (e.g. adjusting the cookie, the parameters, or on partitioning system initialization even creating special child partitions (apple partitioning system)). * Added `int32 *index' parameter to ValidateCreateChild(). So the partitioning system can report at which index the new child shall be inserted. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4065 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -389,7 +389,7 @@ KDiskSystem::ValidateInitialize(KPartition *partition, char *name,
|
||||
bool
|
||||
KDiskSystem::ValidateCreateChild(KPartition *partition, off_t *start,
|
||||
off_t *size, const char *type,
|
||||
const char *parameters)
|
||||
const char *parameters, int32 *index)
|
||||
{
|
||||
// to be implemented by derived classes
|
||||
return false;
|
||||
@@ -422,6 +422,14 @@ KDiskSystem::GetNextSupportedType(KPartition *partition, int32 *cookie,
|
||||
return B_ENTRY_NOT_FOUND;
|
||||
}
|
||||
|
||||
// ShadowPartitionChanged
|
||||
status_t
|
||||
KDiskSystem::ShadowPartitionChanged(KPartition *partition, uint32 operation)
|
||||
{
|
||||
// to be implemented by derived classes
|
||||
return B_ENTRY_NOT_FOUND;
|
||||
}
|
||||
|
||||
// GetTypeForContentType
|
||||
status_t
|
||||
KDiskSystem::GetTypeForContentType(const char *contentType, char *type)
|
||||
|
||||
@@ -235,6 +235,21 @@ KFileSystem::ValidateInitialize(KPartition *partition, char *name,
|
||||
parameters));
|
||||
}
|
||||
|
||||
// ShadowPartitionChanged
|
||||
status_t
|
||||
KFileSystem::ShadowPartitionChanged(KPartition *partition, uint32 operation)
|
||||
{
|
||||
if (!partition)
|
||||
return B_BAD_VALUE;
|
||||
if (!fModule)
|
||||
return B_ERROR;
|
||||
// If not implemented, we assume, that the file system doesn't have to
|
||||
// make any additional changes.
|
||||
if (!fModule->shadow_changed)
|
||||
return B_OK;
|
||||
return fModule->shadow_changed(partition->PartitionData(), operation);
|
||||
}
|
||||
|
||||
// Defragment
|
||||
status_t
|
||||
KFileSystem::Defragment(KPartition *partition, KDiskDeviceJob *job)
|
||||
|
||||
@@ -386,13 +386,17 @@ KPartitioningSystem::ValidateInitialize(KPartition *partition, char *name,
|
||||
bool
|
||||
KPartitioningSystem::ValidateCreateChild(KPartition *partition, off_t *start,
|
||||
off_t *size, const char *type,
|
||||
const char *parameters)
|
||||
const char *parameters, int32 *index)
|
||||
{
|
||||
int32 _index = 0;
|
||||
if (!index)
|
||||
index = &_index;
|
||||
return (partition && start && size && type
|
||||
&& partition->DiskSystem() == this && fModule
|
||||
&& fModule->validate_create_child
|
||||
&& fModule->validate_create_child(partition->PartitionData(),
|
||||
start, size, type, parameters));
|
||||
start, size, type, parameters,
|
||||
index));
|
||||
}
|
||||
|
||||
// CountPartitionableSpaces
|
||||
@@ -455,6 +459,22 @@ KPartitioningSystem::GetTypeForContentType(const char *contentType, char *type)
|
||||
return fModule->get_type_for_content_type(contentType, type);
|
||||
}
|
||||
|
||||
// ShadowPartitionChanged
|
||||
status_t
|
||||
KPartitioningSystem::ShadowPartitionChanged(KPartition *partition,
|
||||
uint32 operation)
|
||||
{
|
||||
if (!partition)
|
||||
return B_BAD_VALUE;
|
||||
if (!fModule)
|
||||
return B_ERROR;
|
||||
// If not implemented, we assume, that the partitioning system doesn't
|
||||
// have to make any additional changes.
|
||||
if (!fModule->shadow_changed)
|
||||
return B_OK;
|
||||
return fModule->shadow_changed(partition->PartitionData(), operation);
|
||||
}
|
||||
|
||||
// Repair
|
||||
status_t
|
||||
KPartitioningSystem::Repair(KPartition *partition, bool checkOnly,
|
||||
|
||||
Reference in New Issue
Block a user