partition_module_info::uninitialize(): Added block size parameter for
convenience. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42141 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -100,7 +100,7 @@ typedef struct partition_module_info {
|
|||||||
status_t (*initialize)(int fd, partition_id partition, const char* name,
|
status_t (*initialize)(int fd, partition_id partition, const char* name,
|
||||||
const char *parameters, off_t partitionSize, disk_job_id job);
|
const char *parameters, off_t partitionSize, disk_job_id job);
|
||||||
status_t (*uninitialize)(int fd, partition_id partition,
|
status_t (*uninitialize)(int fd, partition_id partition,
|
||||||
off_t partitionSize, disk_job_id job);
|
off_t partitionSize, uint32 blockSize, disk_job_id job);
|
||||||
status_t (*create_child)(int fd, partition_id partition, off_t offset,
|
status_t (*create_child)(int fd, partition_id partition, off_t offset,
|
||||||
off_t size, const char* type, const char* name,
|
off_t size, const char* type, const char* name,
|
||||||
const char* parameters, disk_job_id job,
|
const char* parameters, disk_job_id job,
|
||||||
|
|||||||
@@ -1287,24 +1287,10 @@ pm_initialize(int fd, partition_id partitionID, const char* name,
|
|||||||
|
|
||||||
status_t
|
status_t
|
||||||
pm_uninitialize(int fd, partition_id partitionID, off_t partitionSize,
|
pm_uninitialize(int fd, partition_id partitionID, off_t partitionSize,
|
||||||
disk_job_id job)
|
uint32 blockSize, disk_job_id job)
|
||||||
{
|
{
|
||||||
// get partition's block size
|
if (blockSize == 0)
|
||||||
size_t blockSize;
|
return B_BAD_VALUE;
|
||||||
{
|
|
||||||
PartitionReadLocker locker(partitionID);
|
|
||||||
if (!locker.IsLocked())
|
|
||||||
return B_ERROR;
|
|
||||||
|
|
||||||
partition_data* partition = get_partition(partitionID);
|
|
||||||
if (partition == NULL)
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
update_disk_device_job_progress(job, 0.0);
|
|
||||||
|
|
||||||
blockSize = partition->block_size;
|
|
||||||
if (blockSize == 0)
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// We overwrite the first block, which contains the partition table.
|
// We overwrite the first block, which contains the partition table.
|
||||||
// Allocate a buffer, we can clear and write.
|
// Allocate a buffer, we can clear and write.
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ status_t pm_set_type(int fd, partition_id partitionID, const char* type,
|
|||||||
status_t pm_initialize(int fd, partition_id partitionID, const char* name,
|
status_t pm_initialize(int fd, partition_id partitionID, const char* name,
|
||||||
const char* parameters, off_t partitionSize, disk_job_id job);
|
const char* parameters, off_t partitionSize, disk_job_id job);
|
||||||
status_t pm_uninitialize(int fd, partition_id partitionID,
|
status_t pm_uninitialize(int fd, partition_id partitionID,
|
||||||
off_t partitionSize, disk_job_id job);
|
off_t partitionSize, uint32 blockSize, disk_job_id job);
|
||||||
status_t pm_create_child(int fd, partition_id partitionID, off_t offset,
|
status_t pm_create_child(int fd, partition_id partitionID, off_t offset,
|
||||||
off_t size, const char* type, const char* name,
|
off_t size, const char* type, const char* name,
|
||||||
const char* parameters, disk_job_id job,
|
const char* parameters, disk_job_id job,
|
||||||
|
|||||||
@@ -429,7 +429,8 @@ KPartitioningSystem::Uninitialize(KPartition* partition, disk_job_id job)
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
// let the module do its job
|
// let the module do its job
|
||||||
result = fModule->uninitialize(fd, partition->ID(), partition->Size(), job);
|
result = fModule->uninitialize(fd, partition->ID(), partition->Size(),
|
||||||
|
partition->BlockSize(), job);
|
||||||
|
|
||||||
// cleanup and return
|
// cleanup and return
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|||||||
Reference in New Issue
Block a user