yaffs2: Yaffs endian support
[yaffs2.git] / yaffs_yaffs1.c
index da6a40f..e98d04d 100644 (file)
@@ -162,15 +162,15 @@ int yaffs1_scan(struct yaffs_dev *dev)
                                if (in &&
                                    in->variant_type ==
                                     YAFFS_OBJECT_TYPE_FILE &&
-                                   in->variant.file_variant.scanned_size <
+                                   in->variant.file_variant.stored_size <
                                      endpos) {
-                                       in->variant.file_variant.scanned_size =
+                                       in->variant.file_variant.stored_size =
                                            endpos;
                                        if (!dev->param.use_header_file_size) {
                                                in->variant.
                                                    file_variant.file_size =
                                                    in->variant.
-                                                   file_variant.scanned_size;
+                                                   file_variant.stored_size;
                                        }
 
                                }
@@ -323,11 +323,9 @@ int yaffs1_scan(struct yaffs_dev *dev)
                                        case YAFFS_OBJECT_TYPE_FILE:
                                                if (dev->param.
                                                    use_header_file_size)
-
                                                        in->variant.
-                                                        file_variant.file_size
-                                                           = oh->file_size;
-
+                                                       file_variant.file_size
+                                                       = yaffs_oh_to_size(dev, oh, 0);
                                                break;
                                        case YAFFS_OBJECT_TYPE_HARDLINK:
                                                in->variant.