X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/b3b42765712afed5a35c9be5c832f4a06bd85e7a..75339638bc5f21f13d3475374ecbd91065a427c3:/lunaix-os/kernel/fs/ramfs/ramfs.c diff --git a/lunaix-os/kernel/fs/ramfs/ramfs.c b/lunaix-os/kernel/fs/ramfs/ramfs.c index 11ec846..decc080 100644 --- a/lunaix-os/kernel/fs/ramfs/ramfs.c +++ b/lunaix-os/kernel/fs/ramfs/ramfs.c @@ -22,7 +22,7 @@ case, our rootfs will be something like ext2. RamFS vs. TwiFS: Indeed, they are both fs that lives in RAM so - there is no foundmentally differences. However, TwiFS is designed + there is no foundmental differences. However, TwiFS is designed to be a 'virtual FIlesystem for KERnel space' (FIKER), so other kernel sub-modules can just create node and attach their own implementation of read/write, without brothering to create a @@ -52,8 +52,10 @@ ramfs_readdir(struct v_file* file, struct dir_context* dctx) llist_for_each(pos, n, &file->dnode->children, siblings) { if (i++ >= dctx->index) { - dctx->read_complete_callback( - dctx, pos->name.value, pos->name.len, 0); + dctx->read_complete_callback(dctx, + pos->name.value, + pos->name.len, + vfs_get_dtype(pos->inode->itype)); return 1; } } @@ -115,7 +117,7 @@ ramfs_unmount(struct v_superblock* vsb) void ramfs_init() { - struct filesystem* ramfs = fsm_new_fs("ramfs", 5); + struct filesystem* ramfs = fsm_new_fs("ramfs", -1); ramfs->mount = ramfs_mount; ramfs->unmount = ramfs_unmount; @@ -133,5 +135,7 @@ const struct v_inode_ops ramfs_inode_ops = { .mkdir = ramfs_mkdir, const struct v_file_ops ramfs_file_ops = { .readdir = ramfs_readdir, .close = default_file_close, .read = default_file_read, + .read_page = default_file_read, .write = default_file_write, + .write_page = default_file_write, .seek = default_file_seek }; \ No newline at end of file