vfs: rethink fs_type.fs_mount
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
0c29f0e517
commit
8c346a7018
2 changed files with 4 additions and 12 deletions
|
|
@ -193,15 +193,9 @@ static ssize_t get_dents(inode_t *parent, dirent_t **dents)
|
|||
return n;
|
||||
}
|
||||
|
||||
static dirent_t *mount(int flags, struct block_device *bdev)
|
||||
static int init(int flags, inode_t *inode, fs_t **out)
|
||||
{
|
||||
fs_t *new_fs;
|
||||
ssize_t res = ramfs_create(flags, &new_fs);
|
||||
|
||||
if (res < 0)
|
||||
return NULL;
|
||||
|
||||
return new_fs->root_dirent;
|
||||
return ramfs_create(flags, out);
|
||||
}
|
||||
|
||||
static int umount(fs_t *fs)
|
||||
|
|
@ -229,7 +223,7 @@ void ramfs_init(void)
|
|||
ramfs_inode_ops->unlink = unlink;
|
||||
ramfs_inode_ops->get_dents = get_dents;
|
||||
|
||||
struct fs_type ramfs_type = {.name = "ramfs", .fs_mount = mount, .fs_umount = umount};
|
||||
struct fs_type ramfs_type = {.name = "ramfs", .init = init, .fs_umount = umount};
|
||||
|
||||
vfs_register(&ramfs_type);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue