Adjusted according to the changes to the disk_scanner module interface.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2303 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2002-12-25 15:19:12 +00:00
parent 067b3e93d4
commit dcf2d78c94
@@ -38,7 +38,7 @@ get_nth_session_info(int deviceFD, int32 index, session_info *sessionInfo)
} }
// get_nth_partition_info // get_nth_partition_info
/*! \brief Retrieves information about a partion on a device. /*! \brief Retrieves information about a partition on a device.
The fields \c device and \c mounted_at of \a partitionInfo are not set. The fields \c device and \c mounted_at of \a partitionInfo are not set.
@@ -58,14 +58,15 @@ get_nth_partition_info(int deviceFD, int32 sessionIndex, int32 partitionIndex,
{ {
status_t error = (partitionInfo ? B_OK : B_BAD_VALUE); status_t error = (partitionInfo ? B_OK : B_BAD_VALUE);
session_info sessionInfo; session_info sessionInfo;
disk_scanner_module_info *disk_scanner = NULL; disk_scanner_module_info *diskScanner = NULL;
// get the partition scanner module // get the partition scanner module
if (error == B_OK) if (error == B_OK)
error = get_module(DISK_SCANNER_MODULE_NAME, (module_info**)&disk_scanner); error = get_module(DISK_SCANNER_MODULE_NAME,
(module_info**)&diskScanner);
// get the session info // get the session info
if (error == B_OK) { if (error == B_OK) {
error = disk_scanner->get_nth_session_info(deviceFD, sessionIndex, error = diskScanner->get_nth_session_info(deviceFD, sessionIndex,
&sessionInfo); &sessionInfo);
} }
// get the partition info // get the partition info
if (error == B_OK) { if (error == B_OK) {
@@ -78,15 +79,15 @@ get_nth_partition_info(int deviceFD, int32 sessionIndex, int32 partitionIndex,
// of the raw device and construct the partition device name with session and // of the raw device and construct the partition device name with session and
// partition ID. // partition ID.
partitionInfo->info.device[0] = '\0'; partitionInfo->info.device[0] = '\0';
error = disk_scanner->get_nth_partition_info(deviceFD, sessionInfo.offset, error = diskScanner->get_nth_partition_info(deviceFD, &sessionInfo,
sessionInfo.size, partitionInfo); partitionIndex, partitionInfo);
} }
// get the FS info // get the FS info
if (error == B_OK) { if (error == B_OK) {
bool hidden = (partitionInfo->flags & B_HIDDEN_PARTITION); bool hidden = (partitionInfo->flags & B_HIDDEN_PARTITION);
if (!hidden) { if (!hidden) {
error = disk_scanner->get_partition_fs_info(deviceFD, error = diskScanner->get_partition_fs_info(deviceFD,
partitionInfo); partitionInfo);
} }
// in case the partition is no data partition or the FS is unknown, // in case the partition is no data partition or the FS is unknown,
// we fill in the respective fields // we fill in the respective fields
@@ -100,8 +101,8 @@ partitionInfo->info.device[0] = '\0';
// NOTE: Where do we get mounted_at from? // NOTE: Where do we get mounted_at from?
} }
// put the partition scanner module // put the partition scanner module
if (disk_scanner) if (diskScanner)
put_module(disk_scanner->module.name); put_module(diskScanner->module.name);
return error; return error;
} }