From e50b31269a7719b2001ceb3475717dfb858d66f8 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 25 Dec 2002 15:13:25 +0000 Subject: [PATCH] Pass a session_info to the partition functions, rather than a bunch of individual variables. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2297 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/disk_scanner/disk_scanner.h | 25 ++++++++------------- headers/private/disk_scanner/partition.h | 17 +++++--------- 2 files changed, 14 insertions(+), 28 deletions(-) diff --git a/headers/private/disk_scanner/disk_scanner.h b/headers/private/disk_scanner/disk_scanner.h index c8fc690602..63d02244fe 100644 --- a/headers/private/disk_scanner/disk_scanner.h +++ b/headers/private/disk_scanner/disk_scanner.h @@ -17,13 +17,13 @@ typedef status_t (*disk_scanner_get_session_module_hook)(int deviceFD, off_t deviceSize, int32 blockSize, struct session_module_info **sessionModule); typedef status_t (*disk_scanner_get_partition_module_hook)(int deviceFD, - off_t sessionOffset, off_t sessionSize, int32 blockSize, + const struct session_info *sessionInfo, struct partition_module_info **partitionModule); typedef status_t (*disk_scanner_get_nth_session_info_hook)(int deviceFD, int32 index, struct session_info *sessionInfo); typedef status_t (*disk_scanner_get_nth_partition_info_hook)(int deviceFD, - off_t sessionOffset, off_t sessionSize, + const struct session_info *sessionInfo, int32 partitionIndex, struct extended_partition_info *partitionInfo); typedef status_t (*disk_scanner_get_partition_fs_info_hook)(int deviceFD, struct extended_partition_info *partitionInfo); @@ -66,10 +66,7 @@ typedef struct disk_scanner_module_info { params: deviceFD: a device FD - sessionOffset: start of the session in bytes from the beginning of the - device - sessionSize: size of the session in bytes - blockSize: the logical block size + sessionInfo: a complete info about the session the partition resides on partitionModule: buffer the pointer to the found module_info shall be written into @@ -105,6 +102,9 @@ typedef struct disk_scanner_module_info { the indexth partition on the specified session: * offset * size + * logical_block_size + * session + * partition * flags * partition_name * partition_type @@ -112,16 +112,9 @@ typedef struct disk_scanner_module_info { params: deviceFD: a device FD - sessionOffset: start of the session in bytes from the beginning of the - device - sessionSize: size of the session in bytes - partitionInfo: the partition info - - The following fields of partitionInfo are required to be set when the - functions is invoked: - * logical_block_size - * session - * partition + sessionInfo: a complete info about the session the partition resides on + partitionIndex: partition index + partitionInfo: the partition info to be filled in The function first tries to find a suitable partition module and to delagate the work to that module. If no module could be found, for diff --git a/headers/private/disk_scanner/partition.h b/headers/private/disk_scanner/partition.h index c703a54db8..56473e34c2 100644 --- a/headers/private/disk_scanner/partition.h +++ b/headers/private/disk_scanner/partition.h @@ -7,11 +7,10 @@ struct extended_partition_info; -typedef bool (*partition_identify_hook)(int deviceFD, off_t sessionOffset, - off_t sessionSize, const uchar *block, int32 blockSize); +typedef bool (*partition_identify_hook)(int deviceFD, + const struct session_info *session, const uchar *block); typedef status_t (*partition_get_nth_info_hook)(int deviceFD, - off_t sessionOffset, off_t sessionSize, const uchar *block, - int32 blockSize, int32 index, + const struct session_info *session, const uchar *block, int32 index, struct extended_partition_info *partitionInfo); typedef struct partition_module_info { @@ -30,11 +29,8 @@ typedef struct partition_module_info { params: deviceFD: a device FD - sessionOffset: start of the session in bytes from the beginning of the - device - sessionSize: size of the session in bytes + sessionInfo: a complete info about the session the partition resides on block: the first block of the session - blockSize: the logical block size get_nth_info(): @@ -51,11 +47,8 @@ typedef struct partition_module_info { params: deviceFD: a device FD - sessionOffset: start of the session in bytes from the beginning of the - device - sessionSize: size of the session in bytes + sessionInfo: a complete info about the session the partition resides on block: the first block of the session - blockSize: the logical block size index: the partition index partitionInfo: the partition info