[Yaffs] [PATCH] kernel source patchin script, version 2

marty Martin.Fouts at palmsource.com
Tue Jul 12 16:49:23 BST 2005


I've taken a look at Coywolf Qi Hunt's patch and I think it's fine,
but it's not really what we need here, becasue it contains
a very large number of whitespace changes and a small number of
bug fixes, it's not quiet up to date with the YAFFS2 cvs tree,
and it is difficult to compare the two because of all the
white space changes.  (I believe that Coywolf is going in
the right direction for kernel acceptance, but it's too large
a step to take at once, for us.)

Anyway, I've redone my patch-in script, which is more along the
lines of the mtd patchin script. In the process, I fixed a few
odd things to make gcc stop complaining about various warnings
and I got it to the point where it will build as either a
module or an in-kernel bit.

I've simplified the configuration a bit.  Because mtd now
has a nand emulator, I didn't include options to build the
ram simulator, for instance, and I left out options that
we'll never use here; although they'd be easy to add in.

Attached is a patch file that can be applied directly to
the current CVS tree to make the small number of changes
I mentioned, add the patchin script, and create a Kconfig
and Makefile that are appropriate for in-kernel building.

Marty
diff -ruN yaffs2.pristine/Kconfig yaffs2/Kconfig
--- yaffs2.pristine/Kconfig	1969-12-31 16:00:00.000000000 -0800
+++ yaffs2/Kconfig	2005-07-12 02:19:18.000000000 -0700
@@ -0,0 +1,105 @@
+#
+# YAFFS file system configurations
+#
+
+config YAFFS_FS
+	tristate "YAFFS2 file system support"
+	select YAFFS_MTD_SUPPORT
+	help
+	  YAFFS2, or Yet Another Flash Filing System, is a filing system
+	  optimised for NAND Flash chips.
+
+	  To compile the YAFFS2 file system support as a module, choose M here:
+	  the module will be called yaffs2.
+
+	  If unsure, say N.
+
+	  Further information on YAFFS2 is available at
+	  <http://www.aleph1.co.uk/yaffs/>.
+
+config YAFFS_YAFFS2
+	bool "2k page support in YAFFS2"
+	depends on YFFS_FS
+	select YAFFS_MTD2_ENABLED
+	help
+	  This adds the yaffs support for 2k page NAND devices
+
+config YAFFS_MTD_ENABLED
+	bool "NAND mtd support - 512 byte / page devices"
+	depends on YAFFS_FS
+	help
+	  This adds the yaffs file system support for working with a NAND mtd.
+
+	  If unsure, say Y.
+
+config YAFFS2_MTD_ENABLED
+	bool "NAND mtd support - 2048 byte / page devices"
+	depends on YAFFS_FS
+	help
+	  This adds the yaffs file system support for working with a NAND mtd.
+
+	  If unsure, say Y.
+
+config YAFFS_USE_NANDECC
+	bool "Use ECC functions of the generic MTD-NAND driver"
+	depends on YAFFS_FS
+	default y
+	help
+	  This enables the ECC functions of the generic MTD-NAND driver.
+	  This will not work if you are using the old mtd.
+
+	  NB Use NAND ECC does not work at present with yaffsram.
+
+	  If unsure, say Y.
+
+config YAFFS_ECC_WRONG_ORDER
+	bool "Use the same ecc byte order as Steven Hill's nand_ecc.c"
+	depends on YAFFS_FS && !YAFFS_USE_NANDECC
+	help
+	  This makes yaffs_ecc.c use the same ecc byte order as
+	  Steven Hill's nand_ecc.c. If not set, then you get the
+	  same ecc byte order as SmartMedia.
+
+	  If unsure, say N.
+
+config YAFFS_DISABLE_CHUNK_ERASED_CHECK
+	bool "Turn off debug chunk erase check"
+	depends on YAFFS_FS
+	default y
+	help
+	  Enabling this turns off the test that chunks are erased in flash
+	  before writing to them.  This is safe, since the write verification
+	  will fail.  Suggest enabling the test (ie. say N)
+	  during development to help debug things.
+
+	  If unsure, say Y.
+
+config YAFFS_USE_CHUNK_SIZE
+	bool "use chunk size as file block size"
+	depends on YAFFS_FS
+	default n
+	help
+	  Enable this to set file blocksize to the yaffs chunk size.
+	  Disable it to use the page cache size as the fil block size.
+
+	  If unsure, say N.
+
+config YAFFS_TNODE_LIST_DEBUG
+	bool "enable tnode debuging"
+	depends on YAFFS_FS
+	default n
+	help
+	  Turn on tnode debugging.
+
+	  If unsure, say N.
+
+config YAFFS_SHORT_NAMES_IN_RAM
+	bool "Cache short names in RAM"
+	depends on YAFFS_FS
+	default y
+	help
+	  If this config is set, then short names are stored with the
+	  yaffs_Object.  This costs an extra 16 bytes of RAM per object,
+	  but makes look-ups faster.
+
+	  If unsure, say Y.
diff -ruN yaffs2.pristine/Makefile.kernel yaffs2/Makefile.kernel
--- yaffs2.pristine/Makefile.kernel	1969-12-31 16:00:00.000000000 -0800
+++ yaffs2/Makefile.kernel	2005-07-12 02:19:18.000000000 -0700
@@ -0,0 +1,13 @@
+#
+# Makefile for the linux YAFFS filesystem routines.
+#
+
+obj-$(CONFIG_YAFFS_FS) += yaffs.o
+
+yaffs-y := yaffs_ecc.o yaffs_fs.o yaffs_guts.o
+yaffs-y += yaffs_packedtags2.o yaffs_ramem.o yaffs_ramem2k.o
+yaffs-y += yaffs_tagscompat.o yaffs_tagsvalidity.o
+yaffs-y += yaffs_mtdif.o yaffs_mtdif2.o
+
+#yaffs2-$(CONFIG_YAFFS2_MTD_ENABLED) += yaffs_mtdif.o yaffs_mtdif2.o
+#yaffs2-$(CONFIG_YAFFS2_RAM_ENABLED) += yaffs_ramem.o
diff -ruN yaffs2.pristine/patch-ker.sh yaffs2/patch-ker.sh
--- yaffs2.pristine/patch-ker.sh	1969-12-31 16:00:00.000000000 -0800
+++ yaffs2/patch-ker.sh	2005-07-05 23:07:34.000000000 -0700
@@ -0,0 +1,109 @@
+#!/bin/sh
+#
+# YAFFS: Yet another FFS. A NAND-flash specific file system.
+#
+# Copyright (C) 2002 Aleph One Ltd.
+# 
+# Created by Charles Manning <charles at aleph1.co.uk>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# Patch YAFFS into the kernel
+#
+#  args:  kpath  : Full path to kernel sources to be patched
+#
+#  Somewhat "inspired by" the mtd patchin script
+#
+#  $Id: patch-ker.sh,v 1.1 2005/04/06 01:03:46 charles Exp $
+
+VERSION=0
+PATCHLEVEL=0
+SUBLEVEL=0
+LINUXDIR=$1
+
+# To be a Linux directory, it must have a Makefile
+
+
+# Display usage of this script
+usage () {
+	echo "usage:  $0  kernelpath"
+	exit 1
+}
+
+
+
+if [ -z $LINUXDIR ]
+then
+    usage;
+fi
+
+# Check if kerneldir contains a Makefile
+if [ ! -f $LINUXDIR/Makefile ] 
+then 
+	echo "Directory $LINUXDIR does not exist or is not a kernel source directory";
+	exit 1;
+fi
+
+# Get kernel version
+VERSION=`grep -s VERSION <$LINUXDIR/Makefile | head -n 1 | sed s/'VERSION = '//`
+PATCHLEVEL=`grep -s PATCHLEVEL <$LINUXDIR/Makefile | head -n 1 | sed s/'PATCHLEVEL = '//`
+SUBLEVEL=`grep -s SUBLEVEL <$LINUXDIR/Makefile | head -n 1 | sed s/'SUBLEVEL = '//`
+
+# Can we handle this version?
+if [ $VERSION -ne 2  -o $PATCHLEVEL -lt 6  ]
+then 
+	echo "Cannot patch kernel version $VERSION.$PATCHLEVEL.$SUBLEVEL, must be 2.6.x or higher"
+	exit 1;
+fi
+
+
+KCONFIG=$LINUXDIR/fs/Kconfig
+KCONFIGOLD=$LINUXDIR/fs/Kconfig.pre.yaffs
+YAFFS_PATCHED_STRING=`grep -s yaffs <$KCONFIG | head -n 1`
+
+MAKEFILE=$LINUXDIR/fs/Makefile
+MAKEFILEOLD=$LINUXDIR/fs/Makefile.pre.yaffs
+
+if [ ! -z "$YAFFS_PATCHED_STRING" ]
+then
+    YAFFS_PATCHED=0
+    echo "$KCONFIG already mentions YAFFS, so we will not change it"
+else
+   # Change the fs/Kconfig file
+   # Save the old Kconfig
+   # Copy all stuff up to JFFS
+   # Insert some YAFFS stuff
+   # Copy all the rest of the stuff
+
+    YAFFS_PATCHED=1
+    echo "Updating $KCONFIG"
+    mv -f $KCONFIG  $KCONFIGOLD
+    sed -n -e "/JFFS/,99999 ! p" $KCONFIGOLD >$KCONFIG
+    echo "">>$KCONFIG
+    echo "# Patched by YAFFS" >>$KCONFIG
+    echo "source \"fs/yaffs2/Kconfig\"">>$KCONFIG
+    echo "">>$KCONFIG
+    sed -n -e "/JFFS/,99999 p" $KCONFIGOLD >>$KCONFIG
+
+   # now do fs/Makefile -- simply add the target at the end
+    echo "Updating $MAKEFILE"
+    cp -f $MAKEFILE $MAKEFILEOLD
+    echo "">>$MAKEFILE
+    echo "# Patched by YAFFS" >>$MAKEFILE
+    echo "obj-\$(CONFIG_YAFFS_FS)		+= yaffs2/" >>$MAKEFILE
+
+fi
+
+YAFFSDIR=$LINUXDIR/fs/yaffs2
+
+if [ -e $YAFFSDIR ]
+then
+   echo "$YAFFSDIR exists, not patching"
+else
+   mkdir $LINUXDIR/fs/yaffs2
+   cp Makefile.kernel $LINUXDIR/fs/yaffs2/Makefile
+   cp Kconfig $LINUXDIR/fs/yaffs2
+   cp *.c *.h  $LINUXDIR/fs/yaffs2
+fi
diff -ruN yaffs2.pristine/README yaffs2/README
--- yaffs2.pristine/README	1969-12-31 16:00:00.000000000 -0800
+++ yaffs2/README	2005-07-05 22:44:18.000000000 -0700
@@ -0,0 +1,9 @@
+To build YAFFS in the Linux kernel tree you need to run the patch-in-yaffs
+script.
+
+After you've run the script, go back to your normal kernel making procedure
+and configure the yaffs settings you want.
+
+Prolems? Contact the yaffs mailing list.
+
+$Id: README,v 1.2 2005/04/06 01:03:46 charles Exp $
\ No newline at end of file
diff -ruN yaffs2.pristine/yaffs_ecc.c yaffs2/yaffs_ecc.c
--- yaffs2.pristine/yaffs_ecc.c	2005-07-05 22:33:39.000000000 -0700
+++ yaffs2/yaffs_ecc.c	2005-07-12 02:19:09.000000000 -0700
@@ -32,6 +32,7 @@
 const char *yaffs_ecc_c_version = "$Id: yaffs_ecc.c,v 1.2 2005/03/16 04:00:36 charles Exp $";
 
 
+#include <linux/config.h>
 #include "yaffs_ecc.h"
 
 static const unsigned char column_parity_table[] = {
diff -ruN yaffs2.pristine/yaffs_fs.c yaffs2/yaffs_fs.c
--- yaffs2.pristine/yaffs_fs.c	2005-07-05 22:33:39.000000000 -0700
+++ yaffs2/yaffs_fs.c	2005-07-12 02:19:09.000000000 -0700
@@ -164,7 +164,7 @@
 static void yaffs_clear_inode(struct inode *);
 
 static int yaffs_readpage(struct file *file, struct page * page);
-static int yaffs_writepage(struct page *page);
+static int yaffs_writepage(struct page *page,  struct writeback_control *wbc);
 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);
 
@@ -175,8 +175,8 @@
 
 
 static struct address_space_operations yaffs_file_address_operations = {
-	readpage:		yaffs_readpage,
-	writepage:		yaffs_writepage,
+	readpage:	yaffs_readpage,
+	writepage:	yaffs_writepage,
 	prepare_write:	yaffs_prepare_write,
 	commit_write:	yaffs_commit_write
 };
@@ -462,8 +462,7 @@
 	dev = obj->myDev;
 	
 	
-	if (!PageLocked(pg))
-                PAGE_BUG(pg);
+	BUG_ON(!PageLocked(pg));
 
 	pg_buf = kmap(pg);
 	/* FIXME: Can kmap fail? */
@@ -507,7 +506,7 @@
 // writepage inspired by/stolen from smbfs
 //
 
-static int yaffs_writepage(struct page *page)
+static int yaffs_writepage(struct page *page, struct writeback_control *wbc)
 {
 	struct address_space *mapping = page->mapping;
 	struct inode *inode;
@@ -647,7 +646,8 @@
                                init_special_inode(inode, obj->st_mode,old_decode_dev(obj->st_rdev));
 #else
                                  init_special_inode(inode, obj->st_mode,(dev_t)(obj->st_rdev));
-#endif				break;
+#endif
+				break;
 			case S_IFREG:	// file		
 				inode->i_op = &yaffs_file_inode_operations;
 				inode->i_fop = &yaffs_file_operations;
@@ -933,7 +933,8 @@
                         obj = yaffs_MknodSpecial(parent,dentry->d_name.name,mode,current->uid, current->gid,old_encode_dev(rdev));
 #else
                         obj = yaffs_MknodSpecial(parent,dentry->d_name.name,mode,current->uid, current->gid,rdev);
-#endif			break;
+#endif
+			break;
 		case S_IFREG:	// file		
 			T(YAFFS_TRACE_OS,(KERN_DEBUG"yaffs_mknod: making file\n"));
 			obj = yaffs_MknodFile(parent,dentry->d_name.name,mode,current->uid, current->gid);
@@ -1314,7 +1315,7 @@
 	int nBlocks;
 	struct inode * inode = NULL;
 	struct dentry * root;
-	yaffs_Device *dev;
+	yaffs_Device *dev = NULL;
 	int err;
 	
 	sb->s_magic = YAFFS_MAGIC;
@@ -1429,13 +1430,13 @@
 			return NULL;
 		}
 
-		T(YAFFS_TRACE_OS,(" erase %x\n",mtd->erase));
-		T(YAFFS_TRACE_OS,(" read %x\n",mtd->read));
-		T(YAFFS_TRACE_OS,(" write %x\n",mtd->write));
-		T(YAFFS_TRACE_OS,(" readoob %x\n",mtd->read_oob));
-		T(YAFFS_TRACE_OS,(" writeoob %x\n",mtd->write_oob));
-		T(YAFFS_TRACE_OS,(" block_isbad %x\n",mtd->block_isbad));
-		T(YAFFS_TRACE_OS,(" block_markbad %x\n",mtd->block_markbad));
+		T(YAFFS_TRACE_OS,(" erase %p\n",mtd->erase));
+		T(YAFFS_TRACE_OS,(" read %p\n",mtd->read));
+		T(YAFFS_TRACE_OS,(" write %p\n",mtd->write));
+		T(YAFFS_TRACE_OS,(" readoob %p\n",mtd->read_oob));
+		T(YAFFS_TRACE_OS,(" writeoob %p\n",mtd->write_oob));
+		T(YAFFS_TRACE_OS,(" block_isbad %p\n",mtd->block_isbad));
+		T(YAFFS_TRACE_OS,(" block_markbad %p\n",mtd->block_markbad));
 		T(YAFFS_TRACE_OS,(" oobblock %d\n",mtd->oobblock));
 		T(YAFFS_TRACE_OS,(" oobsize %d\n",mtd->oobsize));
 		T(YAFFS_TRACE_OS,(" erasesize %d\n",mtd->erasesize));
@@ -1599,24 +1600,33 @@
 }
 
 
+#ifdef CONFIG_YAFFS_RAM_ENABLED 
 static int yaffs_internal_read_super_ram(struct super_block * sb, void * data, int silent)
 {
 	 return yaffs_internal_read_super(1,1,sb,data,silent) ? 0 : -1;
 }
+#endif
+
+#ifdef CONFIG_YAFFS_MTD_ENABLED
 static int yaffs_internal_read_super_mtd(struct super_block * sb, void * data, int silent)
 {
 	 return yaffs_internal_read_super(1,0,sb,data,silent) ? 0 : -1;
 }
+#endif
 
+#ifdef CONFIG_YAFFS2_RAM_ENABLED
 static int yaffs2_internal_read_super_ram(struct super_block * sb, void * data, int silent)
 {
 	 return yaffs_internal_read_super(2,1,sb,data,silent) ? 0 : -1;
 }
+#endif
+
+#ifdef CONFIG_YAFFS2_MTD_ENABLED
 static int yaffs2_internal_read_super_mtd(struct super_block * sb, void * data, int silent)
 {
 	 return yaffs_internal_read_super(2,0,sb,data,silent) ? 0 : -1;
 }
-
+#endif
 
 
 #ifdef CONFIG_YAFFS_MTD_ENABLED
@@ -1741,7 +1751,10 @@
 
 
 static struct proc_dir_entry *my_proc_entry;
+
+#ifdef CONFIG_YAFFS_RAM_ENABLED
 static struct proc_dir_entry *my_proc_ram_write_entry;
+#endif
 
 static char * yaffs_dump_dev(char *buf,yaffs_Device *dev,char *name)
 {
@@ -1807,6 +1820,7 @@
 }
 
 
+#ifdef CONFIG_YAFFS_RAM_ENABLED
 static int  yaffs_proc_ram_write(
         char *page,
 	char **start,
@@ -1820,7 +1834,7 @@
 	printk(KERN_DEBUG "yaffs write size %d\n",count);
 	return count;
 }
-
+#endif
 
 
 // Stuff to handle installation of file systems
diff -ruN yaffs2.pristine/yaffs_guts.c yaffs2/yaffs_guts.c
--- yaffs2.pristine/yaffs_guts.c	2005-07-05 22:33:39.000000000 -0700
+++ yaffs2/yaffs_guts.c	2005-07-12 02:19:09.000000000 -0700
@@ -16,6 +16,7 @@
 
 const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.8 2005/07/05 23:54:59 charles Exp $";
 
+#include <linux/config.h>
 #include "yportenv.h"
 
 #include "yaffsinterface.h"
@@ -3395,7 +3396,7 @@
 static void yaffs_FlushFilesChunkCache(yaffs_Object *obj)
 {
 	yaffs_Device *dev = obj->myDev;
-	int lowest;
+	int lowest = -1;
 	int i;
 	yaffs_ChunkCache *cache;
 	int chunkWritten = 0;
@@ -4910,8 +4911,8 @@
 	yaffs_ExtendedTags tags;
 	int blk;
 	int blockIterator;
-	int startIterator;
-	int endIterator;
+	int startIterator = 0;
+	int endIterator = 0;
 	int nBlocksToScan = 0;
 	
 	int chunk;
diff -ruN yaffs2.pristine/yaffs_guts.h yaffs2/yaffs_guts.h
--- yaffs2.pristine/yaffs_guts.h	2005-07-05 22:33:39.000000000 -0700
+++ yaffs2/yaffs_guts.h	2005-07-12 02:19:09.000000000 -0700
@@ -23,6 +23,8 @@
 #include "devextras.h"
 #include "yportenv.h"
 
+#define CONFIG_YAFFS_YAFFS2 1
+
 #define YAFFS_OK	1
 #define YAFFS_FAIL  0
 
@@ -527,13 +529,13 @@
 	// NAND access functions (Must be set before calling YAFFS)
 	
 
-	int (*writeChunkToNAND)(struct yaffs_DeviceStruct *dev,int chunkInNAND, const __u8 *data, const yaffs_Spare *spare);
+	int (*writeChunkToNAND)(struct yaffs_DeviceStruct *dev,int chunkInNAND, const __u8 *data, yaffs_Spare *spare);
 	int (*readChunkFromNAND)(struct yaffs_DeviceStruct *dev,int chunkInNAND, __u8 *data, yaffs_Spare *spare);
 	int (*eraseBlockInNAND)(struct yaffs_DeviceStruct *dev,int blockInNAND);	
 	int (*initialiseNAND)(struct yaffs_DeviceStruct *dev);
 
 #ifdef CONFIG_YAFFS_YAFFS2
-	int (*writeChunkWithTagsToNAND)(struct yaffs_DeviceStruct *dev,int chunkInNAND, const __u8 *data, yaffs_ExtendedTags *tags);
+	int (*writeChunkWithTagsToNAND)(struct yaffs_DeviceStruct *dev,int chunkInNAND, const __u8 *data, const yaffs_ExtendedTags *tags);
 	int (*readChunkWithTagsFromNAND)(struct yaffs_DeviceStruct *dev,int chunkInNAND, __u8 *data, yaffs_ExtendedTags *tags);
 	int (*markNANDBlockBad)(struct yaffs_DeviceStruct *dev, int blockNo);
 	int (*queryNANDBlock)(struct yaffs_DeviceStruct *dev, int blockNo, yaffs_BlockState *state, int *sequenceNumber);
diff -ruN yaffs2.pristine/yaffs.mod.c yaffs2/yaffs.mod.c
--- yaffs2.pristine/yaffs.mod.c	1969-12-31 16:00:00.000000000 -0800
+++ yaffs2/yaffs.mod.c	2005-07-12 02:19:09.000000000 -0700
@@ -0,0 +1,21 @@
+#include <linux/module.h>
+#include <linux/vermagic.h>
+#include <linux/compiler.h>
+
+MODULE_INFO(vermagic, VERMAGIC_STRING);
+
+#undef unix
+struct module __this_module
+__attribute__((section(".gnu.linkonce.this_module"))) = {
+ .name = __stringify(KBUILD_MODNAME),
+ .init = init_module,
+#ifdef CONFIG_MODULE_UNLOAD
+ .exit = cleanup_module,
+#endif
+};
+
+static const char __module_depends[]
+__attribute_used__
+__attribute__((section(".modinfo"))) =
+"depends=";
+
diff -ruN yaffs2.pristine/yaffs_mtdif2.c yaffs2/yaffs_mtdif2.c
--- yaffs2.pristine/yaffs_mtdif2.c	2005-07-05 22:33:39.000000000 -0700
+++ yaffs2/yaffs_mtdif2.c	2005-07-12 02:19:09.000000000 -0700
@@ -17,6 +17,7 @@
 
 const char *yaffs_mtdif2_c_version = "$Id: yaffs_mtdif2.c,v 1.1 2004/12/17 04:39:04 charles Exp $";
 
+#include <linux/config.h>
 #ifdef CONFIG_YAFFS_MTD_ENABLED
  
 #include "yportenv.h"
@@ -43,7 +44,7 @@
 
 	yaffs_PackedTags2 pt;
 	
-	T(YAFFS_TRACE_MTD,(TSTR("nandmtd2_WriteChunkWithTagsToNAND chunk %d data %08x tags %08x" TENDSTR),chunkInNAND,data,tags));	
+	T(YAFFS_TRACE_MTD,(TSTR("nandmtd2_WriteChunkWithTagsToNAND chunk %d data %p tags %p" TENDSTR),chunkInNAND,data,tags));	
 
 	if(tags)
 	{
@@ -87,7 +88,7 @@
 	
 	yaffs_PackedTags2 pt;
 
-	T(YAFFS_TRACE_MTD,(TSTR("nandmtd2_ReadChunkWithTagsToNAND chunk %d data %08x tags %08x" TENDSTR),chunkInNAND,data,tags));	
+	T(YAFFS_TRACE_MTD,(TSTR("nandmtd2_ReadChunkWithTagsToNAND chunk %d data %p tags %p" TENDSTR),chunkInNAND,data,tags));	
 
 #ifndef	CONFIG_YAFFS_USE_OLD_MTD
 	if(data && tags)
diff -ruN yaffs2.pristine/yaffs_mtdif.c yaffs2/yaffs_mtdif.c
--- yaffs2.pristine/yaffs_mtdif.c	2005-07-05 22:33:39.000000000 -0700
+++ yaffs2/yaffs_mtdif.c	2005-07-12 02:19:09.000000000 -0700
@@ -15,6 +15,8 @@
 
 const char *yaffs_mtdif_c_version = "$Id: yaffs_mtdif.c,v 1.1 2004/12/17 04:39:04 charles Exp $";
 
+#include <linux/config.h>
+
 #ifdef CONFIG_YAFFS_MTD_ENABLED
  
 #include "yportenv.h"
diff -ruN yaffs2.pristine/yaffs_tagscompat.c yaffs2/yaffs_tagscompat.c
--- yaffs2.pristine/yaffs_tagscompat.c	2005-07-05 22:33:39.000000000 -0700
+++ yaffs2/yaffs_tagscompat.c	2005-07-12 02:19:09.000000000 -0700
@@ -13,16 +13,18 @@
  * $Id: yaffs_tagscompat.c,v 1.2 2005/03/16 04:00:36 charles Exp $
  */
 
+#include <linux/config.h>
 #include "yaffs_guts.h"
 #include "yaffs_tagscompat.h"
 #include "yaffs_ecc.h"
 
 static void yaffs_HandleReadDataError(yaffs_Device *dev,int chunkInNAND);
+#ifdef NOTYET
 static void yaffs_CheckWrittenBlock(yaffs_Device *dev,int chunkInNAND);
 static void yaffs_HandleWriteChunkOk(yaffs_Device *dev,int chunkInNAND,const __u8 *data, const yaffs_Spare *spare);
 static void yaffs_HandleUpdateChunk(yaffs_Device *dev,int chunkInNAND, const yaffs_Spare *spare);
 static void yaffs_HandleWriteChunkError(yaffs_Device *dev,int chunkInNAND);
-
+#endif
 
 
 static const char yaffs_countBitsTable[256] =
@@ -307,6 +309,7 @@
 
 
 
+#ifdef NOTYET
 static int yaffs_CheckChunkErased(struct yaffs_DeviceStruct *dev,int chunkInNAND)
 {
 
@@ -331,7 +334,7 @@
 	return YAFFS_OK;
 
 }
-
+#endif
 
 #if 0
 int yaffs_EraseBlockInNAND(struct yaffs_DeviceStruct *dev,int blockInNAND)
@@ -480,6 +483,7 @@
 }
 
 
+#ifdef NOTYET
 static void yaffs_CheckWrittenBlock(yaffs_Device *dev,int chunkInNAND)
 {
 }
@@ -502,9 +506,6 @@
 	yaffs_DeleteChunk(dev,chunkInNAND,1,__LINE__);
 }
 
-
-
-
 static int yaffs_VerifyCompare(const __u8 *d0, const __u8 * d1, const yaffs_Spare *s0, const yaffs_Spare *s1)
 {
 
@@ -530,6 +531,7 @@
 
 	return 1;
 }
+#endif /* NOTYET */
 
 #if 0
 typedef struct
diff -ruN yaffs2.pristine/yaffs_tagsvalidity.c yaffs2/yaffs_tagsvalidity.c
--- yaffs2.pristine/yaffs_tagsvalidity.c	2005-07-05 22:33:39.000000000 -0700
+++ yaffs2/yaffs_tagsvalidity.c	2005-07-12 02:19:09.000000000 -0700
@@ -15,6 +15,7 @@
  */
 //yaffs_tagsvalidity.c
 
+#include <linux/config.h>
 #include "yaffs_tagsvalidity.h"
 
 



More information about the yaffs mailing list