feat: device subsystem rework
[lunaix-os.git] / lunaix-os / kernel / fs / ramfs / ramfs.c
index 37f8869ac6ca3ec322d3f87e4dc4a610adcaa4a3..e2d1263607c2c8a79a596e7d2f40f00f0cb32938 100644 (file)
@@ -41,7 +41,7 @@
     'mountibility' for other fs.
 */
 
-volatile static inode_t ino = 0;
+static volatile inode_t ino = 0;
 
 extern const struct v_inode_ops ramfs_inode_ops;
 extern const struct v_file_ops ramfs_file_ops;
@@ -119,8 +119,8 @@ void
 ramfs_inode_init(struct v_superblock* vsb, struct v_inode* inode)
 {
     inode->id = ino++;
-    inode->ops = &ramfs_inode_ops;
-    inode->default_fops = &ramfs_file_ops;
+    inode->ops = (struct v_inode_ops*)&ramfs_inode_ops;
+    inode->default_fops = (struct v_file_ops*)&ramfs_file_ops;
 }
 
 int
@@ -146,6 +146,7 @@ ramfs_init()
 
     fsm_register(ramfs);
 }
+EXPORT_FILE_SYSTEM(ramfs, ramfs_init);
 
 int
 ramfs_mksymlink(struct v_inode* this, const char* target)
@@ -192,8 +193,10 @@ ramfs_unlink(struct v_inode* this)
     if ((rinode->flags & RAMF_SYMLINK)) {
         rinode->flags &= ~RAMF_SYMLINK;
         this->itype &= ~VFS_IFSYMLINK;
+
         vfree(rinode->symlink);
-        return;
+
+        return 0;
     }
 
     // TODO