Add generic sendfile method for yaffs2, also thereby allowing loopback mount.
[yaffs2.git] / yaffs_fs.c
index 2a631623f82eb2563d47c57bac8047360e0cd52b..3ded1fe8751bdfb8e52aa17daf507bd303702c87 100644 (file)
@@ -31,7 +31,7 @@
  */
 
 const char *yaffs_fs_c_version =
-    "$Id: yaffs_fs.c,v 1.37 2005-12-14 01:18:45 charles Exp $";
+    "$Id: yaffs_fs.c,v 1.39 2006-01-24 22:22:52 tpoynor Exp $";
 extern const char *yaffs_guts_c_version;
 
 #include <linux/config.h>
@@ -171,6 +171,10 @@ static struct file_operations yaffs_file_operations = {
        .mmap = generic_file_mmap,
        .flush = yaffs_file_flush,
        .fsync = yaffs_sync_object,
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+       .sendfile = generic_file_sendfile,
+#endif
+
 };
 
 static struct inode_operations yaffs_file_inode_operations = {
@@ -1365,7 +1369,7 @@ static struct super_block *yaffs_internal_read_super(int yaffsVersion,
        T(YAFFS_TRACE_OS, (" erasesize %d\n", mtd->erasesize));
        T(YAFFS_TRACE_OS, (" size %d\n", mtd->size));
        
-#if CONFIG_YAFFS_AUTO_YAFFS2
+#ifdef CONFIG_YAFFS_AUTO_YAFFS2
 
        if (yaffsVersion == 1 && 
            mtd->oobblock >= 2048) {