Added user_partition_data::content_size field. Small change to support a NULL parameter in _kern_supports_resizing_partition().

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4129 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2003-07-30 00:24:22 +00:00
parent 738e4a700b
commit 71346466b8
2 changed files with 6 additions and 5 deletions
@@ -17,6 +17,7 @@ struct user_partition_data {
partition_id shadow_id;
off_t offset;
off_t size;
off_t content_size;
uint32 block_size;
uint32 status;
uint32 flags;
@@ -55,7 +56,7 @@ struct user_disk_device_job_info {
disk_job_id id;
uint32 type;
partition_id partition;
char desription[256];
char description[256];
};
// iterating, retrieving device/partition data
@@ -697,8 +697,6 @@ _kern_supports_resizing_partition(partition_id partitionID,
int32 changeCounter, bool *canResizeContents,
bool *whileMounted)
{
if (!canResizeContents)
return false;
KDiskDeviceManager *manager = KDiskDeviceManager::Default();
// get the partition
KPartition *partition = manager->ReadLockPartition(partitionID);
@@ -724,8 +722,10 @@ _kern_supports_resizing_partition(partition_id partitionID,
return false;
// get the child disk system
KDiskSystem *childDiskSystem = partition->DiskSystem();
*canResizeContents = (childDiskSystem
&& childDiskSystem->SupportsResizing(partition, whileMounted));
if (canResizeContents) {
*canResizeContents = (childDiskSystem
&& childDiskSystem->SupportsResizing(partition, whileMounted));
}
// TODO: Currently we report that we cannot resize the contents, if the
// partition's disk system is unknown. I found this more logical. It doesn't
// really matter, though, since the API user can check for this situation.