[Yaffs] [PATCH] Add support 2.6.23 filesystem interface API.

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Ian McDonnell
Date:  
To: yaffs
Subject: [Yaffs] [PATCH] Add support 2.6.23 filesystem interface API.
Support Linux 2.6.23 filesystem interface API:

Add include linux/sched.h.
Drop sendfile, add splice_read and splice_write methods -- ifdef'ed for compatibility.
Ifdef-out unused function yaffs_remount_fs.
Add const to yaffs_proc_write buffer pointer.

Signed-off-by: Ian McDonnell <>

Index: yportenv.h
===================================================================
RCS file: /home/aleph1/cvs/yaffs2/yportenv.h,v
retrieving revision 1.15
diff -u -I ''\''$Id'\''' -I ''\''$Revision'\''' -u -a -I '$Id' -r1.15 yportenv.h
--- yportenv.h    18 Jul 2007 19:40:38 -0000    1.15
+++ yportenv.h    10 Sep 2007 21:12:22 -0000
@@ -32,6 +32,7 @@
 #endif
 #include <linux/kernel.h>
 #include <linux/mm.h>
+#include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
Index: yaffs_fs.c
===================================================================
RCS file: /home/aleph1/cvs/yaffs2/yaffs_fs.c,v
retrieving revision 1.62
diff -u -I ''\''$Id'\''' -I ''\''$Revision'\''' -u -a -I '$Id' -r1.62 yaffs_fs.c
--- yaffs_fs.c    16 Aug 2007 20:42:11 -0000    1.62
+++ yaffs_fs.c    10 Sep 2007 21:12:23 -0000
@@ -213,24 +213,45 @@
     .commit_write = yaffs_commit_write,
 };


+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22))
+static struct file_operations yaffs_file_operations = {
+    .read = do_sync_read,
+    .write = do_sync_write,
+    .aio_read = generic_file_aio_read,
+    .aio_write = generic_file_aio_write,
+    .mmap = generic_file_mmap,
+    .flush = yaffs_file_flush,
+    .fsync = yaffs_sync_object,
+    .splice_read = generic_file_splice_read,
+    .splice_write = generic_file_splice_write,
+};
+
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18))
+
 static struct file_operations yaffs_file_operations = {
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18))
     .read = do_sync_read,
     .write = do_sync_write,
     .aio_read = generic_file_aio_read,
     .aio_write = generic_file_aio_write,
+    .mmap = generic_file_mmap,
+    .flush = yaffs_file_flush,
+    .fsync = yaffs_sync_object,
+    .sendfile = generic_file_sendfile,
+};
+
 #else
+
+static struct file_operations yaffs_file_operations = {
     .read = generic_file_read,
     .write = generic_file_write,
-#endif
     .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
-
 };
+#endif


 static struct inode_operations yaffs_file_inode_operations = {
     .setattr = yaffs_setattr,
@@ -1430,6 +1451,7 @@


static LIST_HEAD(yaffs_dev_list);

+#if 0 // not used
 static int yaffs_remount_fs(struct super_block *sb, int *flags, char *data)
 {
     yaffs_Device    *dev = yaffs_SuperToDevice(sb);
@@ -1458,6 +1480,7 @@


     return 0;
 }
+#endif


 static void yaffs_put_super(struct super_block *sb)
 {
@@ -2095,7 +2118,7 @@
     unsigned rg = 0, mask_bitfield;
     char *end;
     char *mask_name;
-    char *x; 
+    const char *x; 
     char substring[MAX_MASK_NAME_LENGTH+1];
     int i;
     int done = 0;