From 0b1ab795f411a664a77b961943a6ccf5538333f7 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 26 Jan 2003 15:06:23 +0000 Subject: [PATCH] Got rid of the module_identify() hook. Instead the module info features a short_name field now. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2554 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/disk_scanner/partition.h | 21 +++++++------------ .../kernel/disk_scanner/partition/intel.c | 15 ++++++------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/headers/private/disk_scanner/partition.h b/headers/private/disk_scanner/partition.h index b55000513c..915b7854ca 100644 --- a/headers/private/disk_scanner/partition.h +++ b/headers/private/disk_scanner/partition.h @@ -29,15 +29,22 @@ typedef status_t (*partition_partition_hook)(int deviceFD, typedef struct partition_module_info { module_info module; + const char *short_name; partition_identify_hook identify; partition_get_nth_info_hook get_nth_info; - partition_identify_module_hook identify_module; partition_get_partitioning_params_hook get_partitioning_params; partition_partition_hook partition; } partition_module_info; /* + short_name: + ---------- + + Identifies the module. That's the identifier to be passed to + partition_session(). + + identify(): ---------- @@ -76,18 +83,6 @@ typedef struct partition_module_info { range. - identify_module(): - ----------------- - - Returns whether the module knows the supplied identifier. The module to - be used to partition a session is identified by this identifier. - - params: - identifier: the identifier - - Returns true, if the module knows the identifier, false otherwise. - - get_partitioning_params(): ------------------------- diff --git a/src/add-ons/kernel/disk_scanner/partition/intel.c b/src/add-ons/kernel/disk_scanner/partition/intel.c index c3d0e4ebbc..bc36919169 100644 --- a/src/add-ons/kernel/disk_scanner/partition/intel.c +++ b/src/add-ons/kernel/disk_scanner/partition/intel.c @@ -21,6 +21,10 @@ #define INTEL_PARTITION_MODULE_NAME "disk_scanner/partition/intel/v1" +// partition module identifier +//static const char *const kShortModuleName = "intel"; +#define kShortModuleName "intel" + // the maximal number of partitions we support (size of some static arrays) static const int32 MAX_PARTITION_COUNT = 64; @@ -427,14 +431,6 @@ intel_get_nth_info(int deviceFD, const session_info *sessionInfo, return error; } -// intel_identify_module -static -bool -intel_identify_module(const char *identifier) -{ - return (identifier && !strcmp(identifier, "intel")); -} - // intel_get_partitioning_params static status_t @@ -466,9 +462,10 @@ static partition_module_info intel_partition_module = 0, // better B_KEEP_LOADED? std_ops }, + kShortModuleName, + intel_identify, intel_get_nth_info, - intel_identify_module, intel_get_partitioning_params, intel_partition, };