[Yaffs] [PATCH] linux-2.6-00-minimal-compile-fixup

Luc Van Oostenryck luc.vanoostenryck@easynet.be
Fri, 28 Jan 2005 03:33:04 +0100


This is a multi-part message in MIME format.
--------------030403050603070301060002
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit


--------------030403050603070301060002
Content-Type: text/plain;
 name="yaffs-2.6-00-minimal-compile-fixup.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="yaffs-2.6-00-minimal-compile-fixup.patch"

diff -Nurp y0/fs/yaffs/yaffs_fs.c y1/fs/yaffs/yaffs_fs.c
--- y0/fs/yaffs/yaffs_fs.c	Fri Jan 28 02:32:17 2005
+++ y1/fs/yaffs/yaffs_fs.c	Fri Jan 28 02:39:58 2005
@@ -153,7 +153,11 @@ static void yaffs_delete_inode(struct in
 static void yaffs_clear_inode(struct inode *);
 
 static int yaffs_readpage(struct file *file, struct page * page);
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))
+static int yaffs_writepage(struct page *page, struct writeback_control *wbc);
+#else
 static int yaffs_writepage(struct page *page);
+#endif
 static int yaffs_prepare_write(struct file *f, struct page *pg, unsigned offset, unsigned to);
 static int yaffs_commit_write(struct file *f, struct page *pg, unsigned offset, unsigned to);
 
@@ -504,7 +508,11 @@ static int yaffs_readpage(struct file *f
 // writepage inspired by/stolen from smbfs
 //
 
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))
+static int yaffs_writepage(struct page *page, struct writeback_control *wbc)
+#else
 static int yaffs_writepage(struct page *page)
+#endif
 {
 	struct address_space *mapping = page->mapping;
 	struct inode *inode;
@@ -1306,7 +1314,11 @@ static struct super_block *yaffs_interna
 #ifdef CONFIG_YAFFS_RAM_ENABLED
 		// Set the yaffs_Device up for ram emulation
 
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+		sb->s_fs_info =		dev = kmalloc(sizeof(yaffs_Device),GFP_KERNEL);
+#else
 		sb->u.generic_sbp =	dev = kmalloc(sizeof(yaffs_Device),GFP_KERNEL);
+#endif
 		if(!dev)
 		{
 			// Deep shit could not allocate device structure
@@ -1530,13 +1542,12 @@ static struct super_block *yaffs_ram_rea
 
 /* changes NCB 2.5.70 */
 //static DECLARE_FSTYPE(yaffs_fs_type, "yaffs", yaffs_read_super, FS_REQUIRES_DEV);
-static struct file_system_type yaffs_fs_type = {
+static struct file_system_type yaffs_ram_fs_type = {
 	.owner		= THIS_MODULE,
 	.name		= "yaffsram",
 	.get_sb		= yaffs_ram_read_super,
 	.kill_sb	= kill_block_super,
 //	.kill_sb	= kill_litter_super,
-	.fs_flags	= FS_SINGLE,
 };
 #else
 static struct super_block *yaffs_ram_read_super(struct super_block * sb, void * data, int silent)
diff -Nurp y0/fs/yaffs/yaffs_ramem.c y1/fs/yaffs/yaffs_ramem.c
--- y0/fs/yaffs/yaffs_ramem.c	Fri Jan 28 02:32:17 2005
+++ y1/fs/yaffs/yaffs_ramem.c	Fri Jan 28 02:35:43 2005
@@ -19,6 +19,8 @@ const char *yaffs_ramem_c_version = "$Id
 
 #ifndef __KERNEL__
 #define CONFIG_YAFFS_RAM_ENABLED
+#else
+#include <linux/config.h>
 #endif
 
 #ifdef CONFIG_YAFFS_RAM_ENABLED
@@ -33,10 +35,10 @@ const char *yaffs_ramem_c_version = "$Id
 
 #define EM_SIZE_IN_MEG 2
 
-#define BLOCK_SIZE (32 * 528)
+#define NAND_BLOCK_SIZE (32 * 528)
 #define BLOCKS_PER_MEG ((1024*1024)/(32 * 512))
 #define FILE_SIZE_IN_BLOCKS (FILE_SIZE_IN_MEG * BLOCKS_PER_MEG)
-#define FILE_SIZE_IN_BYTES (FILE_SIZE_IN_BLOCKS * BLOCK_SIZE)
+#define FILE_SIZE_IN_BYTES (FILE_SIZE_IN_BLOCKS * NAND_BLOCK_SIZE)
 
 
 

--------------030403050603070301060002--