feat: (iso9660) directory read support
[lunaix-os.git] / lunaix-os / kernel / fs / ramfs / ramfs.c
index 11ec8463aa4f8db47097bc8eb3e936e6d45aa7c4..f33d330818504725a23292fc412f5e8425b63cfc 100644 (file)
@@ -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;