PCI 16x50 UART Controller, O2 Enablement (#39)
[lunaix-os.git] / lunaix-os / kernel / fs / iso9660 / directory.c
index c3150dcbb64426b7da5bd2fe5c4ed5469694a2be..9f4d988f8c39606fd7f7e1160ecbff0bbfe433f5 100644 (file)
@@ -1,4 +1,3 @@
-#include <lunaix/dirent.h>
 #include <lunaix/fs.h>
 #include <lunaix/fs/iso9660.h>
 #include <lunaix/mm/cake.h>
@@ -7,6 +6,8 @@
 
 #include <klibc/string.h>
 
+#include <usr/lunaix/dirent_defs.h>
+
 extern struct cake_pile* drec_cache_pile;
 
 void
@@ -51,10 +52,12 @@ done:
         u32_t l = drec->name.len;
         while (l < (u32_t)-1 && drec->name.content[l--] != ';')
             ;
+
         l = (l + 1) ? l : drec->name.len;
         l = MIN(l, ISO9660_IDLEN - 1);
 
-        strncpy(cache->name_val, drec->name.content, l);
+        strncpy(cache->name_val, (const char*)drec->name.content, l);
+
         cache->name = HSTR(cache->name_val, l);
         hstr_rehash(&cache->name, HSTR_FULL_HASH);
     }
@@ -63,7 +66,7 @@ done:
 int
 iso9660_setup_dnode(struct v_dnode* dnode, struct v_inode* inode)
 {
-    if (!(inode->itype & VFS_IFDIR)) {
+    if ((inode->itype & F_FILE)) {
         vfs_assign_inode(dnode, inode);
         return 0;
     }
@@ -85,7 +88,8 @@ iso9660_setup_dnode(struct v_dnode* dnode, struct v_inode* inode)
     do {
         if (blk_offset >= ISO9660_BLKSZ - sizeof(struct iso_drecord)) {
             current_pos += ISO9660_BLKSZ;
-            errno = dev->read(dev, records, blk + current_pos, ISO9660_BLKSZ);
+            errno =
+              dev->ops.read(dev, records, blk + current_pos, ISO9660_BLKSZ);
             if (errno < 0) {
                 errno = EIO;
                 goto done;