From 71346466b84579367342bacf727e7a07a9c833fa Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 30 Jul 2003 00:24:22 +0000 Subject: [PATCH] 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 --- .../kernel/disk_device_manager/ddm_userland_interface.h | 3 ++- .../core/disk_device_manager/ddm_userland_interface.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/headers/private/kernel/disk_device_manager/ddm_userland_interface.h b/headers/private/kernel/disk_device_manager/ddm_userland_interface.h index 03c948834b..77a9f93800 100644 --- a/headers/private/kernel/disk_device_manager/ddm_userland_interface.h +++ b/headers/private/kernel/disk_device_manager/ddm_userland_interface.h @@ -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 diff --git a/src/kernel/core/disk_device_manager/ddm_userland_interface.cpp b/src/kernel/core/disk_device_manager/ddm_userland_interface.cpp index 25aefb4c37..090b857bca 100644 --- a/src/kernel/core/disk_device_manager/ddm_userland_interface.cpp +++ b/src/kernel/core/disk_device_manager/ddm_userland_interface.cpp @@ -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.