refactor: make pci device driver loading passive, pci bus scanner will not load them...
[lunaix-os.git] / lunaix-os / kernel / fs / iso9660 / inode.c
index fa3337b88f5d993f9d4dc3e6907b4d1f1ed3ba69..58d1b8f8c98822c0b624b1c06e390c1972aefe42 100644 (file)
@@ -14,9 +14,9 @@ static struct v_inode_ops iso_inode_ops = {
 
 static struct v_file_ops iso_file_ops = { .close = iso9660_close,
                                           .read = iso9660_read,
-                                          .read_page = iso9660_read,
+                                          .read_page = iso9660_read_page,
                                           .write = iso9660_write,
-                                          .write_page = iso9660_write,
+                                          .write_page = iso9660_write_page,
                                           .seek = iso9660_seek,
                                           .readdir = iso9660_readdir };
 
@@ -61,6 +61,7 @@ iso9660_fill_inode(struct v_inode* inode, struct iso_drecache* dir, int ino)
 
     inode->id = ino;
     inode->lb_addr = dir->extent_addr;
+    inode->lb_usage = ICEIL(dir->data_size, fu_len);
     inode->ops = &iso_inode_ops;
     inode->default_fops = &iso_file_ops;
 
@@ -76,8 +77,8 @@ iso9660_fill_inode(struct v_inode* inode, struct iso_drecache* dir, int ino)
     if (dir->xattr_len) {
         struct iso_xattr* xattr = (struct iso_xattr*)valloc(ISO9660_BLKSZ);
         // Only bring in single FU, as we only care about the attributes.
-        errno =
-          dev->read(dev, xattr, ISO9660_BLKSZ * inode->lb_addr, ISO9660_BLKSZ);
+        errno = dev->ops.read(
+          dev, xattr, ISO9660_BLKSZ * inode->lb_addr, ISO9660_BLKSZ);
         if (errno < 0) {
             return EIO;
         }