diff --git a/fs/vfs/ramfs.c b/fs/vfs/ramfs.c index 652a392..d5af89c 100644 --- a/fs/vfs/ramfs.c +++ b/fs/vfs/ramfs.c @@ -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); } diff --git a/include/fs/vfs.h b/include/fs/vfs.h index 07081fc..cdff9e2 100644 --- a/include/fs/vfs.h +++ b/include/fs/vfs.h @@ -5,8 +5,6 @@ #include #include -#include - #include #include @@ -33,7 +31,7 @@ struct fs_type { char name[256]; - dirent_t *(*fs_mount)(int flags, struct block_device *bdev); + int (*init)(int flags, inode_t *inode, fs_t **out); int (*fs_umount)(fs_t *fs); };