Added syscall for uninitialization.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4778 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
4c4e5505b0
commit
20c33ce79b
@ -192,6 +192,8 @@ status_t _kern_initialize_partition(partition_id partitionID,
|
||||
int32 changeCounter,
|
||||
const char *diskSystemName,
|
||||
const char *name, const char *parameters);
|
||||
status_t _kern_uninitialize_partition(partition_id partitionID,
|
||||
int32 changeCounter);
|
||||
status_t _kern_create_child_partition(partition_id partitionID,
|
||||
int32 changeCounter, off_t offset,
|
||||
off_t size, const char *type,
|
||||
|
@ -1614,6 +1614,23 @@ _kern_initialize_partition(partition_id partitionID, int32 changeCounter,
|
||||
partition, B_PARTITION_INITIALIZE);
|
||||
}
|
||||
|
||||
// _kern_uninitialize_partition
|
||||
status_t
|
||||
_kern_uninitialize_partition(partition_id partitionID, int32 changeCounter)
|
||||
{
|
||||
KDiskDeviceManager *manager = KDiskDeviceManager::Default();
|
||||
// get the partition
|
||||
KPartition *partition = manager->WriteLockPartition(partitionID);
|
||||
if (!partition)
|
||||
return B_ENTRY_NOT_FOUND;
|
||||
PartitionRegistrar registrar1(partition, true);
|
||||
PartitionRegistrar registrar2(partition->Device(), true);
|
||||
DeviceWriteLocker locker(partition->Device(), true);
|
||||
// unitialize the partition's contents and set the new parameters
|
||||
partition->UninitializeContents(true);
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
// _kern_create_child_partition
|
||||
status_t
|
||||
_kern_create_child_partition(partition_id partitionID, int32 changeCounter,
|
||||
|
Loading…
Reference in New Issue
Block a user