+ Updated PARTSCAN_MODULE_NAME to DISK_SCANNER_MODULE_NAME
+ Fixed an error with disk_scanner_get_partition_fs_info() that was causing the fs module to not be unloaded when identification succeeded. The next time around, get_module() was returning B_OK, by the module pointer was being set to NULL. I'm not sure if this is the expected behaviour of the emulator, so we may want to investigate. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2286 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -11,7 +11,7 @@ struct partition_module_info;
|
|||||||
struct session_info;
|
struct session_info;
|
||||||
struct session_module_info;
|
struct session_module_info;
|
||||||
|
|
||||||
#define PARTSCAN_MODULE_NAME "disk_scanner/disk_scanner/v1"
|
#define DISK_SCANNER_MODULE_NAME "disk_scanner/disk_scanner/v1"
|
||||||
|
|
||||||
typedef status_t (*disk_scanner_get_session_module_hook)(int deviceFD,
|
typedef status_t (*disk_scanner_get_session_module_hook)(int deviceFD,
|
||||||
off_t deviceSize, int32 blockSize,
|
off_t deviceSize, int32 blockSize,
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ static const char *kSessionModulePrefix = "disk_scanner/session";
|
|||||||
static const char *kPartitionModulePrefix = "disk_scanner/partition";
|
static const char *kPartitionModulePrefix = "disk_scanner/partition";
|
||||||
static const char *kFSModulePrefix = "disk_scanner/fs";
|
static const char *kFSModulePrefix = "disk_scanner/fs";
|
||||||
|
|
||||||
#define TRACE(x)
|
//#define TRACE(x)
|
||||||
//#define TRACE(x) dprintf x
|
#define TRACE(x) dprintf x
|
||||||
|
|
||||||
// prototypes
|
// prototypes
|
||||||
static status_t read_block(int fd, off_t offset, size_t size, uchar **block);
|
static status_t read_block(int fd, off_t offset, size_t size, uchar **block);
|
||||||
@@ -284,12 +284,13 @@ disk_scanner_get_partition_fs_info(int deviceFD,
|
|||||||
while (read_next_module_name(list, moduleName, &bufferSize)
|
while (read_next_module_name(list, moduleName, &bufferSize)
|
||||||
== B_OK) {
|
== B_OK) {
|
||||||
fs_module_info *module = NULL;
|
fs_module_info *module = NULL;
|
||||||
if (get_module(moduleName, (module_info**)&module) == B_OK) {
|
TRACE(("disk_scanner: trying fs module: `%s'\n", moduleName));
|
||||||
if (module->identify(deviceFD, partitionInfo)) {
|
if (get_module(moduleName, (module_info**)&module) == B_OK && module) {
|
||||||
|
if (module->identify(deviceFD, partitionInfo))
|
||||||
error = B_OK;
|
error = B_OK;
|
||||||
break;
|
|
||||||
}
|
|
||||||
put_module(moduleName);
|
put_module(moduleName);
|
||||||
|
if (error == B_OK)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close_module_list(list);
|
close_module_list(list);
|
||||||
@@ -301,7 +302,7 @@ static disk_scanner_module_info disk_scanner_module =
|
|||||||
{
|
{
|
||||||
// module_info
|
// module_info
|
||||||
{
|
{
|
||||||
PARTSCAN_MODULE_NAME,
|
DISK_SCANNER_MODULE_NAME,
|
||||||
0, // better B_KEEP_LOADED?
|
0, // better B_KEEP_LOADED?
|
||||||
std_ops
|
std_ops
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user