diff --git a/fs/vfs/ramfs.c b/fs/vfs/ramfs.c index b620ba7..cd62dfa 100644 --- a/fs/vfs/ramfs.c +++ b/fs/vfs/ramfs.c @@ -40,6 +40,7 @@ int ramfs_create(u64 flags, fs_t **out) memcpy(&fs->fs_ops, ramfs_ops, sizeof(struct fs_ops)); root_inode->mode = S_IFDIR; + memcpy(&root_inode->i_ops, ramfs_inode_ops, sizeof(struct inode_ops)); fs->root_dirent = root; root->type = S_IFDIR; @@ -70,6 +71,8 @@ static int alloc_inode(fs_t *fs, u64 mode, inode_t **out) ret->mode = mode; ret->ino_num = atomic_xadd(&inode_ticker, 1); + memcpy(&ret->i_ops, ramfs_inode_ops, sizeof(struct inode_ops)); + *out = ret; return 0; }