Now stores the module name of the modules handling the partition.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7994 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2004-06-15 17:04:05 +00:00
parent 082a2195f0
commit 50ef9ecfb6
+12 -5
View File
@@ -8,6 +8,7 @@
#include <boot/partitions.h> #include <boot/partitions.h>
#include <boot/vfs.h> #include <boot/vfs.h>
#include <boot/platform.h>
#include <boot/stdio.h> #include <boot/stdio.h>
#include <ddm_modules.h> #include <ddm_modules.h>
#include <util/kernel_cpp.h> #include <util/kernel_cpp.h>
@@ -17,8 +18,8 @@
using namespace boot; using namespace boot;
#define TRACE_PARTITIONS 0 #define TRACE_PARTITIONS
#if TRACE_PARTITIONS #ifdef TRACE_PARTITIONS
# define TRACE(x) printf x # define TRACE(x) printf x
#else #else
# define TRACE(x) ; # define TRACE(x) ;
@@ -27,7 +28,7 @@ using namespace boot;
/* supported partition modules */ /* supported partition modules */
static partition_module_info *sPartitionModules[] = { static const partition_module_info *sPartitionModules[] = {
#ifdef BOOT_SUPPORT_PARTITION_AMIGA #ifdef BOOT_SUPPORT_PARTITION_AMIGA
&gAmigaPartitionModule, &gAmigaPartitionModule,
#endif #endif
@@ -183,10 +184,13 @@ Partition::Mount(Directory **_fileSystem)
Directory *fileSystem; Directory *fileSystem;
if (module->get_file_system(this, &fileSystem) == B_OK) { if (module->get_file_system(this, &fileSystem) == B_OK) {
gRoot->AddVolume(fileSystem); gRoot->AddVolume(fileSystem, this);
if (_fileSystem) if (_fileSystem)
*_fileSystem = fileSystem; *_fileSystem = fileSystem;
// remember the module name that mounted us
fModuleName = module->module_name;
fIsFileSystem = true; fIsFileSystem = true;
return B_OK; return B_OK;
} }
@@ -204,7 +208,7 @@ Partition::Scan(bool mountFileSystems)
TRACE(("Partition::Scan()\n")); TRACE(("Partition::Scan()\n"));
for (int32 i = 0; i < sNumPartitionModules; i++) { for (int32 i = 0; i < sNumPartitionModules; i++) {
partition_module_info *module = sPartitionModules[i]; const partition_module_info *module = sPartitionModules[i];
void *cookie; void *cookie;
NodeOpener opener(this, O_RDONLY); NodeOpener opener(this, O_RDONLY);
@@ -241,6 +245,9 @@ Partition::Scan(bool mountFileSystems)
while ((child = (Partition *)fChildren.RemoveHead()) != NULL) while ((child = (Partition *)fChildren.RemoveHead()) != NULL)
delete child; delete child;
// remember the module name that identified us
fModuleName = module->module.name;
return B_OK; return B_OK;
} }
} }