Hello folks,
attached is the patch that fixes the yaffs2 compilation breakage for
2.6.19-rc1 kernel.
Any objections on committing that into the CVS?
Vitaly
Index: linux-2.6.18/fs/yaffs2/yaffs_fs.c
===================================================================
--- linux-2.6.18.orig/fs/yaffs2/yaffs_fs.c
+++ linux-2.6.18/fs/yaffs2/yaffs_fs.c
@@ -89,7 +89,11 @@ unsigned yaffs_traceMask = YAFFS_TRACE_A
/*#define T(x) printk x */
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18))
+#define yaffs_InodeToObject(iptr) ((yaffs_Object *)((iptr)->i_private))
+#else
#define yaffs_InodeToObject(iptr) ((yaffs_Object *)((iptr)->u.generic_ip))
+#endif
#define yaffs_DentryToObject(dptr) yaffs_InodeToObject((dptr)->d_inode)
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
@@ -189,8 +193,15 @@ static struct address_space_operations y
};
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,
+#else
.read = generic_file_read,
.write = generic_file_write,
+#endif
.mmap = generic_file_mmap,
.flush = yaffs_file_flush,
.fsync = yaffs_sync_object,
@@ -408,7 +419,11 @@ static void yaffs_clear_inode(struct ino
* the yaffs_Object.
*/
obj->myInode = NULL;
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18))
+ inode->i_private = NULL;
+#else
inode->u.generic_ip = NULL;
+#endif
/* If the object freeing was deferred, then the real
* free happens now.
@@ -704,7 +719,9 @@ static void yaffs_FillInodeFromObject(st
inode->i_mode = obj->yst_mode;
inode->i_uid = obj->yst_uid;
inode->i_gid = obj->yst_gid;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
inode->i_blksize = inode->i_sb->s_blocksize;
+#endif
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
inode->i_rdev = old_decode_dev(obj->yst_rdev);
@@ -756,7 +773,11 @@ static void yaffs_FillInodeFromObject(st
break;
}
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18))
+ inode->i_private = obj;
+#else
inode->u.generic_ip = obj;
+#endif
obj->myInode = inode;
} else {