Forgot to set the stream type for the root directory...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@516 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
60aa4feab5
commit
b98a89a763
@ -232,7 +232,7 @@ static int
|
|||||||
rootfs_mount(fs_id id, const char *device, void *args, fs_cookie *_fs, vnode_id *root_vnid)
|
rootfs_mount(fs_id id, const char *device, void *args, fs_cookie *_fs, vnode_id *root_vnid)
|
||||||
{
|
{
|
||||||
struct rootfs *fs;
|
struct rootfs *fs;
|
||||||
struct rootfs_vnode *v;
|
struct rootfs_vnode *vnode;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
TRACE(("rootfs_mount: entry\n"));
|
TRACE(("rootfs_mount: entry\n"));
|
||||||
@ -248,39 +248,40 @@ rootfs_mount(fs_id id, const char *device, void *args, fs_cookie *_fs, vnode_id
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto err1;
|
goto err1;
|
||||||
|
|
||||||
fs->vnode_list_hash = hash_init(ROOTFS_HASH_SIZE, (addr)&v->all_next - (addr)v,
|
fs->vnode_list_hash = hash_init(ROOTFS_HASH_SIZE, (addr)&vnode->all_next - (addr)vnode,
|
||||||
&rootfs_vnode_compare_func, &rootfs_vnode_hash_func);
|
&rootfs_vnode_compare_func, &rootfs_vnode_hash_func);
|
||||||
if (fs->vnode_list_hash == NULL) {
|
if (fs->vnode_list_hash == NULL) {
|
||||||
err = ENOMEM;
|
err = ENOMEM;
|
||||||
goto err2;
|
goto err2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a vnode
|
// create the root vnode
|
||||||
v = rootfs_create_vnode(fs);
|
vnode = rootfs_create_vnode(fs);
|
||||||
if (v == NULL) {
|
if (vnode == NULL) {
|
||||||
err = ENOMEM;
|
err = ENOMEM;
|
||||||
goto err3;
|
goto err3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set it up
|
// set it up
|
||||||
v->parent = v;
|
vnode->parent = vnode;
|
||||||
v->name = kstrdup("");
|
vnode->name = kstrdup("");
|
||||||
if (v->name == NULL) {
|
if (vnode->name == NULL) {
|
||||||
err = ENOMEM;
|
err = ENOMEM;
|
||||||
goto err4;
|
goto err4;
|
||||||
}
|
}
|
||||||
|
|
||||||
v->stream.dir.dir_head = NULL;
|
vnode->stream.type = STREAM_TYPE_DIR;
|
||||||
fs->root_vnode = v;
|
vnode->stream.dir.dir_head = NULL;
|
||||||
hash_insert(fs->vnode_list_hash, v);
|
fs->root_vnode = vnode;
|
||||||
|
hash_insert(fs->vnode_list_hash, vnode);
|
||||||
|
|
||||||
*root_vnid = v->id;
|
*root_vnid = vnode->id;
|
||||||
*_fs = fs;
|
*_fs = fs;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err4:
|
err4:
|
||||||
rootfs_delete_vnode(fs, v, true);
|
rootfs_delete_vnode(fs, vnode, true);
|
||||||
err3:
|
err3:
|
||||||
hash_uninit(fs->vnode_list_hash);
|
hash_uninit(fs->vnode_list_hash);
|
||||||
err2:
|
err2:
|
||||||
|
Loading…
Reference in New Issue
Block a user