Volume::Initialize() needs a valid nspace object in the kernel - this fixes the

"*** remove ..." error messages when initializing a BFS image via the bfs_shell.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14591 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-10-31 12:03:27 +00:00
parent 959a5a68bc
commit 1893013260
4 changed files with 16 additions and 8 deletions

View File

@ -5,7 +5,9 @@
*/
#define COMPILE_FOR_R5
#ifndef COMPILE_FOR_R5
# define COMPILE_FOR_R5
#endif
#include "Debug.h"
#include "Volume.h"
@ -399,7 +401,8 @@ bfs_initialize(const char *deviceName, void *parms, size_t len)
return -1;
}
Volume volume(-1);
Volume volume(2);
// we just happen to know it's 2...
status_t status = volume.Initialize(deviceName, volumeName, blockSize, flags);
if (status < B_OK) {
FATAL(("Initializing volume failed: %s\n", strerror(status)));

View File

@ -94,7 +94,6 @@ main(int argc, char **argv)
if (initialize) {
const char *deviceName = arg;
initialize_fs(deviceName, argv + argi, argc - argi);
} else {
if (arg != NULL && !isdigit(arg[0]))
disk_name = arg;

View File

@ -40,7 +40,6 @@ init_fs(char *disk_name)
exit(0);
}
data = sys_mount(1, "myfs", -1, "/myfs", disk_name, 0, NULL, 0);
if (data == NULL) {
printf("could not mount %s on /myfs\n", disk_name);

View File

@ -3386,13 +3386,20 @@ status_t
initialize_file_system(const char *device, const char *fsName, void *params,
int paramLength)
{
struct nspace *mount;
status_t error;
fsystem *fs = inc_file_system(fsName);
if (!fs)
if (fs == NULL || fs->ops.initialize == NULL)
return FS_ERROR;
mount = (nspace *)malloc(sizeof(nspace));
if (add_nspace(mount, NULL, "myfs", -1, -1) < B_OK) {
error = B_ERROR;
} else {
error = (*fs->ops.initialize)(device, params, paramLength);
remove_nspace(mount);
}
dec_file_system(fs);