changeset 413:d94b1449bddc

yaffs: Integrate Android tree differences This brings in Android changes, and a few more clean-ups to normalise with the Android tree. More to follow maybe. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
author Charles Manning <cdhmanning@gmail.com>
date Tue, 27 Apr 2010 14:06:38 +1200
parents 1d5b15b2a69d
children 60b3b6fbb259
files Kconfig Makefile yaffs_checkptrw.h yaffs_guts.c yaffs_mtdif2.c yaffs_nand.c yportenv.h
diffstat 7 files changed, 18 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/Kconfig
+++ b/Kconfig
@@ -102,26 +102,6 @@ config YAFFS_DISABLE_TAGS_ECC
 
 	  If unsure, say N.
 
-config YAFFS_DISABLE_LAZY_LOAD
-	bool "Disable lazy loading"
-	depends on YAFFS_YAFFS2
-	default n
-	help
-	  "Lazy loading" defers loading file details until they are
-	  required. This saves mount time, but makes the first look-up
-	  a bit longer.
-
-	  Lazy loading will only happen if enabled by this option being 'n'
-	  and if the appropriate tags are available, else yaffs2 will
-	  automatically fall back to immediate loading and do the right
-	  thing.
-
-	  Lazy laoding will be required by checkpointing.
-
-	  Setting this to 'y' will disable lazy loading.
-
-	  If unsure, say N.
-
 
 config YAFFS_DISABLE_WIDE_TNODES
 	bool "Turn off wide tnodes"
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# Main Makefile for YAFFS
+# Main Makefile for out-of-tree yaffs2.ko building
 #
 #
 # YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
--- a/yaffs_checkptrw.h
+++ b/yaffs_checkptrw.h
@@ -32,4 +32,3 @@ int yaffs_CheckpointInvalidateStream(yaf
 
 
 #endif
-
--- a/yaffs_guts.c
+++ b/yaffs_guts.c
@@ -33,6 +33,7 @@
 /* Note YAFFS_GC_GOOD_ENOUGH must be <= YAFFS_GC_PASSIVE_THRESHOLD */
 #define YAFFS_GC_GOOD_ENOUGH 2
 #define YAFFS_GC_PASSIVE_THRESHOLD 4
+
 #define YAFFS_SMALL_HOLE_THRESHOLD 3
 
 #include "yaffs_ecc.h"
@@ -179,7 +180,7 @@ static __u32 ShiftsGE(__u32 x)
 
 static __u32 Shifts(__u32 x)
 {
-	int nShifts;
+	__u32 nShifts;
 
 	nShifts =  0;
 
@@ -5132,8 +5133,6 @@ int yaffs_DoWriteDataToFile(yaffs_Object
 	dev = in->myDev;
 
 	while (n > 0 && chunkWritten >= 0) {
-		/* chunk = offset / dev->nDataBytesPerChunk + 1; */
-		/* start = offset % dev->nDataBytesPerChunk; */
 		yaffs_AddrToChunk(dev, offset, &chunk, &start);
 
 		if (chunk * dev->nDataBytesPerChunk + start != offset ||
@@ -5143,7 +5142,7 @@ int yaffs_DoWriteDataToFile(yaffs_Object
 			   TENDSTR),
 			   (int)offset, chunk, start));
 		}
-		chunk++;
+		chunk++; /* File pos to chunk in file offset */
 
 		/* OK now check for the curveball where the start and end are in
 		 * the same chunk.
--- a/yaffs_mtdif2.c
+++ b/yaffs_mtdif2.c
@@ -179,8 +179,14 @@ int nandmtd2_ReadChunkWithTagsFromNAND(y
 	if (localData)
 		yaffs_ReleaseTempBuffer(dev, data, __LINE__);
 
-	if (tags && retval == -EBADMSG && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR)
+	if (tags && retval == -EBADMSG && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR) {
 		tags->eccResult = YAFFS_ECC_RESULT_UNFIXED;
+		dev->eccUnfixed++;
+	}
+	if(tags && retval == -EUCLEAN && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR) {
+		tags->eccResult = YAFFS_ECC_RESULT_FIXED;
+		dev->eccFixed++;
+	}
 	if (retval == 0)
 		return YAFFS_OK;
 	else
--- a/yaffs_nand.c
+++ b/yaffs_nand.c
@@ -43,7 +43,8 @@ int yaffs_ReadChunkWithTagsFromNAND(yaff
 	if (tags &&
 	   tags->eccResult > YAFFS_ECC_RESULT_NO_ERROR) {
 
-		yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, chunkInNAND/dev->param.nChunksPerBlock);
+		yaffs_BlockInfo *bi;
+		bi = yaffs_GetBlockInfo(dev, chunkInNAND/dev->param.nChunksPerBlock);
 		yaffs_HandleChunkError(dev, bi);
 	}
 
--- a/yportenv.h
+++ b/yportenv.h
@@ -155,7 +155,11 @@
 
 
 #ifndef YBUG
-#define YBUG() do {T(YAFFS_TRACE_BUG, (TSTR("==>> yaffs bug: " __FILE__ " %d" TENDSTR), __LINE__)); } while (0)
+#define YBUG() do {\
+	T(YAFFS_TRACE_BUG,\
+		(TSTR("==>> yaffs bug: " __FILE__ " %d" TENDSTR),\
+		__LINE__));\
+} while (0)
 #endif
 
 #endif