feat: a pseudo shell environment for basic interacting and testing purpose
[lunaix-os.git] / lunaix-os / kernel / fs / ramfs / ramfs.c
index 3dcbd5908882243fcdd49ee19afa3a1c9d585d1c..11ec8463aa4f8db47097bc8eb3e936e6d45aa7c4 100644 (file)
@@ -42,6 +42,7 @@
 volatile static inode_t ino = 0;
 
 extern const struct v_inode_ops ramfs_inode_ops;
 volatile static inode_t ino = 0;
 
 extern const struct v_inode_ops ramfs_inode_ops;
+extern const struct v_file_ops ramfs_file_ops;
 
 int
 ramfs_readdir(struct v_file* file, struct dir_context* dctx)
 
 int
 ramfs_readdir(struct v_file* file, struct dir_context* dctx)
@@ -88,7 +89,7 @@ ramfs_inode_init(struct v_superblock* vsb, struct v_inode* inode)
 {
     inode->id = ino++;
     inode->ops = &ramfs_inode_ops;
 {
     inode->id = ino++;
     inode->ops = &ramfs_inode_ops;
-    inode->default_fops = &default_file_ops;
+    inode->default_fops = &ramfs_file_ops;
 }
 
 int
 }
 
 int
@@ -127,4 +128,10 @@ const struct v_inode_ops ramfs_inode_ops = { .mkdir = ramfs_mkdir,
                                                default_inode_dirlookup,
                                              .create = ramfs_create,
                                              .open = default_inode_open,
                                                default_inode_dirlookup,
                                              .create = ramfs_create,
                                              .open = default_inode_open,
-                                             .rename = default_inode_rename };
\ No newline at end of file
+                                             .rename = default_inode_rename };
+
+const struct v_file_ops ramfs_file_ops = { .readdir = ramfs_readdir,
+                                           .close = default_file_close,
+                                           .read = default_file_read,
+                                           .write = default_file_write,
+                                           .seek = default_file_seek };
\ No newline at end of file