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
This commit is contained in:
Ingo Weinhold 2002-12-25 15:13:25 +00:00
parent bc2988951f
commit e50b31269a
2 changed files with 14 additions and 28 deletions

View File

@ -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

View File

@ -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