Added missing module initialization/uninitialization.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20341 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2007-03-06 07:52:24 +00:00
parent 4ed322c66e
commit 5b89b67d95
3 changed files with 22 additions and 0 deletions

View File

@ -21,6 +21,19 @@ HaikuKernelFileSystem::HaikuKernelFileSystem(file_system_module_info* fsModule)
// destructor // destructor
HaikuKernelFileSystem::~HaikuKernelFileSystem() HaikuKernelFileSystem::~HaikuKernelFileSystem()
{ {
// call the kernel module uninitialization
if (fFSModule->info.std_ops)
fFSModule->info.std_ops(B_MODULE_UNINIT);
}
// Init
status_t
HaikuKernelFileSystem::Init()
{
// call the kernel module initialization
if (!fFSModule->info.std_ops)
return B_OK;
return fFSModule->info.std_ops(B_MODULE_INIT);
} }
// CreateVolume // CreateVolume

View File

@ -15,6 +15,8 @@ public:
file_system_module_info* fsModule); file_system_module_info* fsModule);
virtual ~HaikuKernelFileSystem(); virtual ~HaikuKernelFileSystem();
status_t Init();
virtual status_t CreateVolume(Volume** volume, mount_id id); virtual status_t CreateVolume(Volume** volume, mount_id id);
virtual status_t DeleteVolume(Volume* volume); virtual status_t DeleteVolume(Volume* volume);

View File

@ -273,8 +273,15 @@ UserlandFSServer::_CreateHaikuKernelInterface(const char* fsName,
= new(nothrow) HaikuKernelFileSystem(module); = new(nothrow) HaikuKernelFileSystem(module);
if (!fileSystem) if (!fileSystem)
RETURN_ERROR(B_NO_MEMORY); RETURN_ERROR(B_NO_MEMORY);
ObjectDeleter<HaikuKernelFileSystem> fsDeleter(fileSystem);
// init the FS
error = fileSystem->Init();
if (error != B_OK)
return error;
// everything went fine // everything went fine
fsDeleter.Detach();
*_fileSystem = fileSystem; *_fileSystem = fileSystem;
return B_OK; return B_OK;
} }