From 1f3f1294a80fce3af96644308de32d0c1c67b315 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 16 Jul 2003 21:00:01 +0000 Subject: [PATCH] Added a IsSubSystemFor() method to the KDiskSystem interface and respective calls for the module interfaces. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3996 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../private/kernel/disk_device_manager/KDiskSystem.h | 1 + .../private/kernel/disk_device_manager/KFileSystem.h | 1 + .../kernel/disk_device_manager/KPartitioningSystem.h | 1 + .../private/kernel/disk_device_manager/ddm_modules.h | 12 ++++++++---- src/add-ons/kernel/disk_scanner/fs/bfs.c | 1 + .../kernel/partitioning_systems/intel/intel.cpp | 2 ++ src/kernel/core/disk_device_manager/KDiskSystem.cpp | 8 ++++++++ src/kernel/core/disk_device_manager/KFileSystem.cpp | 8 ++++++++ .../core/disk_device_manager/KPartitioningSystem.cpp | 8 ++++++++ 9 files changed, 38 insertions(+), 4 deletions(-) diff --git a/headers/private/kernel/disk_device_manager/KDiskSystem.h b/headers/private/kernel/disk_device_manager/KDiskSystem.h index c96bd38558..a93ae903dc 100644 --- a/headers/private/kernel/disk_device_manager/KDiskSystem.h +++ b/headers/private/kernel/disk_device_manager/KDiskSystem.h @@ -64,6 +64,7 @@ public: virtual bool SupportsInitializing(KPartition *partition); virtual bool SupportsInitializingChild(KPartition *child, const char *diskSystem); + virtual bool IsSubSystemFor(KPartition *partition); virtual bool ValidateResize(KPartition *partition, off_t *size); virtual bool ValidateResizeChild(KPartition *partition, off_t *size); diff --git a/headers/private/kernel/disk_device_manager/KFileSystem.h b/headers/private/kernel/disk_device_manager/KFileSystem.h index e9253d5d00..da679ce60c 100644 --- a/headers/private/kernel/disk_device_manager/KFileSystem.h +++ b/headers/private/kernel/disk_device_manager/KFileSystem.h @@ -40,6 +40,7 @@ public: virtual bool SupportsSettingContentName(KPartition *partition, bool *whileMounted); virtual bool SupportsInitializing(KPartition *partition); + virtual bool IsSubSystemFor(KPartition *partition); virtual bool ValidateResize(KPartition *partition, off_t *size); virtual bool ValidateMove(KPartition *partition, off_t *start); diff --git a/headers/private/kernel/disk_device_manager/KPartitioningSystem.h b/headers/private/kernel/disk_device_manager/KPartitioningSystem.h index fc8bbf929c..b5cef38a32 100644 --- a/headers/private/kernel/disk_device_manager/KPartitioningSystem.h +++ b/headers/private/kernel/disk_device_manager/KPartitioningSystem.h @@ -44,6 +44,7 @@ public: virtual bool SupportsInitializing(KPartition *partition); virtual bool SupportsInitializingChild(KPartition *child, const char *diskSystem); + virtual bool IsSubSystemFor(KPartition *partition); virtual bool ValidateResize(KPartition *partition, off_t *size); virtual bool ValidateResizeChild(KPartition *partition, off_t *size); diff --git a/headers/private/kernel/disk_device_manager/ddm_modules.h b/headers/private/kernel/disk_device_manager/ddm_modules.h index 39ff0dbf99..2feca52cae 100644 --- a/headers/private/kernel/disk_device_manager/ddm_modules.h +++ b/headers/private/kernel/disk_device_manager/ddm_modules.h @@ -47,6 +47,7 @@ typedef bool (*partition_supports_initializing_partition)( partition_data *partition); typedef bool (*partition_supports_initializing_child_partition)( partition_data *partition, const char *system); +typedef bool (*partition_is_sub_system_for)(partition_data *partition); typedef bool (*partition_validate_resize_partition)(partition_data *partition, off_t *size); @@ -75,10 +76,10 @@ typedef bool (*partition_get_partitionable_spaces)(partition_data *partition, partitionable_space_data *spaces, int32 count, int32 *actualCount); // When not implemented, a standard algorithm is used. -typedef bool (*partition_get_next_supported_type)(partition_data *partition, - int32 *cookie, char *type); -typedef bool (*partition_get_type_for_content_type)(partition_data *partition, - const char *contentType, char *type); +typedef status_t (*partition_get_next_supported_type)( + partition_data *partition, int32 *cookie, char *type); +typedef status_t (*partition_get_type_for_content_type)( + partition_data *partition, const char *contentType, char *type); // writing // (device is NOT locked) @@ -142,6 +143,7 @@ typedef struct partition_module_info { supports_initializing_partition; partition_supports_initializing_child_partition supports_initializing_child_partition; + partition_is_sub_system_for is_sub_system_for; partition_validate_resize_partition validate_resize_partition; partition_validate_resize_child_partition @@ -205,6 +207,7 @@ typedef bool (*fs_supports_moving_partition)(partition_data *partition, typedef bool (*fs_supports_setting_content_name)(partition_data *partition, bool *whileMounted); typedef bool (*fs_supports_initializing_partition)(partition_data *partition); +typedef bool (*fs_is_sub_system_for)(partition_data *partition); typedef bool (*fs_validate_resize_partition)(partition_data *partition, off_t *size); @@ -255,6 +258,7 @@ typedef struct fs_module_info { fs_supports_setting_content_name supports_setting_content_name; fs_supports_initializing_partition supports_initializing_partition; + fs_is_sub_system_for is_sub_system_for; fs_validate_resize_partition validate_resize_partition; fs_validate_move_partition validate_move_partition; diff --git a/src/add-ons/kernel/disk_scanner/fs/bfs.c b/src/add-ons/kernel/disk_scanner/fs/bfs.c index fb346fc133..e72efb9f39 100644 --- a/src/add-ons/kernel/disk_scanner/fs/bfs.c +++ b/src/add-ons/kernel/disk_scanner/fs/bfs.c @@ -277,6 +277,7 @@ static fs_module_info bfs_module = { NULL, // supports_moving_partition NULL, // supports_setting_content_name NULL, // supports_initializing_partition + NULL, // is_sub_system_for NULL, // validate_resize_partition NULL, // validate_move_partition diff --git a/src/add-ons/kernel/partitioning_systems/intel/intel.cpp b/src/add-ons/kernel/partitioning_systems/intel/intel.cpp index 56a8565490..71393a2527 100644 --- a/src/add-ons/kernel/partitioning_systems/intel/intel.cpp +++ b/src/add-ons/kernel/partitioning_systems/intel/intel.cpp @@ -319,6 +319,7 @@ static partition_module_info intel_partition_map_module = { NULL, // supports_deleting_child_partition NULL, // supports_initializing_partition NULL, // supports_initializing_child_partition + NULL, // is_sub_system_for NULL, // validate_resize_partition NULL, // validate_resize_child_partition @@ -395,6 +396,7 @@ static partition_module_info intel_extended_partition_module = { NULL, // supports_deleting_child_partition NULL, // supports_initializing_partition NULL, // supports_initializing_child_partition + NULL, // is_sub_system_for NULL, // validate_resize_partition NULL, // validate_resize_child_partition diff --git a/src/kernel/core/disk_device_manager/KDiskSystem.cpp b/src/kernel/core/disk_device_manager/KDiskSystem.cpp index 596b84a7f2..10e7aaafaf 100644 --- a/src/kernel/core/disk_device_manager/KDiskSystem.cpp +++ b/src/kernel/core/disk_device_manager/KDiskSystem.cpp @@ -271,6 +271,14 @@ KDiskSystem::SupportsInitializingChild(KPartition *child, return false; } +// IsSubSystemFor +bool +KDiskSystem::IsSubSystemFor(KPartition *partition) +{ + // to be implemented by derived classes + return false; +} + // ValidateResize bool KDiskSystem::ValidateResize(KPartition *partition, off_t *size) diff --git a/src/kernel/core/disk_device_manager/KFileSystem.cpp b/src/kernel/core/disk_device_manager/KFileSystem.cpp index aee1e7058b..9057b43e37 100644 --- a/src/kernel/core/disk_device_manager/KFileSystem.cpp +++ b/src/kernel/core/disk_device_manager/KFileSystem.cpp @@ -150,6 +150,14 @@ KFileSystem::SupportsInitializing(KPartition *partition) return false; } +// IsSubSystemFor +bool +KFileSystem::IsSubSystemFor(KPartition *partition) +{ + // to be implemented + return false; +} + // ValidateResize bool KFileSystem::ValidateResize(KPartition *partition, off_t *size) diff --git a/src/kernel/core/disk_device_manager/KPartitioningSystem.cpp b/src/kernel/core/disk_device_manager/KPartitioningSystem.cpp index 6ee9aa5b16..448e213ae3 100644 --- a/src/kernel/core/disk_device_manager/KPartitioningSystem.cpp +++ b/src/kernel/core/disk_device_manager/KPartitioningSystem.cpp @@ -205,6 +205,14 @@ KPartitioningSystem::SupportsInitializingChild(KPartition *child, return false; } +// IsSubSystemFor +bool +KPartitioningSystem::IsSubSystemFor(KPartition *partition) +{ + // to be implemented + return false; +} + // ValidateResize bool KPartitioningSystem::ValidateResize(KPartition *partition, off_t *size)