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:
@@ -5,7 +5,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define COMPILE_FOR_R5
|
#ifndef COMPILE_FOR_R5
|
||||||
|
# define COMPILE_FOR_R5
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "Debug.h"
|
#include "Debug.h"
|
||||||
#include "Volume.h"
|
#include "Volume.h"
|
||||||
@@ -399,7 +401,8 @@ bfs_initialize(const char *deviceName, void *parms, size_t len)
|
|||||||
return -1;
|
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);
|
status_t status = volume.Initialize(deviceName, volumeName, blockSize, flags);
|
||||||
if (status < B_OK) {
|
if (status < B_OK) {
|
||||||
FATAL(("Initializing volume failed: %s\n", strerror(status)));
|
FATAL(("Initializing volume failed: %s\n", strerror(status)));
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ main(int argc, char **argv)
|
|||||||
if (initialize) {
|
if (initialize) {
|
||||||
const char *deviceName = arg;
|
const char *deviceName = arg;
|
||||||
initialize_fs(deviceName, argv + argi, argc - argi);
|
initialize_fs(deviceName, argv + argi, argc - argi);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (arg != NULL && !isdigit(arg[0]))
|
if (arg != NULL && !isdigit(arg[0]))
|
||||||
disk_name = arg;
|
disk_name = arg;
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ init_fs(char *disk_name)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
data = sys_mount(1, "myfs", -1, "/myfs", disk_name, 0, NULL, 0);
|
data = sys_mount(1, "myfs", -1, "/myfs", disk_name, 0, NULL, 0);
|
||||||
if (data == NULL) {
|
if (data == NULL) {
|
||||||
printf("could not mount %s on /myfs\n", disk_name);
|
printf("could not mount %s on /myfs\n", disk_name);
|
||||||
|
|||||||
@@ -3386,14 +3386,21 @@ status_t
|
|||||||
initialize_file_system(const char *device, const char *fsName, void *params,
|
initialize_file_system(const char *device, const char *fsName, void *params,
|
||||||
int paramLength)
|
int paramLength)
|
||||||
{
|
{
|
||||||
|
struct nspace *mount;
|
||||||
status_t error;
|
status_t error;
|
||||||
|
|
||||||
fsystem *fs = inc_file_system(fsName);
|
fsystem *fs = inc_file_system(fsName);
|
||||||
if (!fs)
|
if (fs == NULL || fs->ops.initialize == NULL)
|
||||||
return FS_ERROR;
|
return FS_ERROR;
|
||||||
|
|
||||||
error = (*fs->ops.initialize)(device, params, paramLength);
|
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);
|
dec_file_system(fs);
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
|
|||||||
Reference in New Issue
Block a user