yaffs: Integrate Android tree differences
authorCharles Manning <cdhmanning@gmail.com>
Tue, 27 Apr 2010 02:06:38 +0000 (14:06 +1200)
committerCharles Manning <cdhmanning@gmail.com>
Tue, 27 Apr 2010 02:08:44 +0000 (14:08 +1200)
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>
Kconfig
Makefile
yaffs_checkptrw.h
yaffs_guts.c
yaffs_mtdif2.c
yaffs_nand.c
yportenv.h

diff --git a/Kconfig b/Kconfig
index 8c218e3767ffaa1c080ce4e40116cb9a359f7214..d4363edcdbfe685f2c3a3bc6b1c0add79b26379e 100644 (file)
--- 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"
index f297efa878c065e6dad5d248d59c9935691b3b25..919afc054668812eae28188918c5ac429905eb51 100644 (file)
--- 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.
index 3350d1ecbf8e78c787b34a7fba3c27e5b6bb16e6..881c3659c8a98ea6c8a83234bb7b50766af3db6c 100644 (file)
@@ -32,4 +32,3 @@ int yaffs_CheckpointInvalidateStream(yaffs_Device *dev);
 
 
 #endif
-
index d77ee4745d79e29d1e18ceeafc57a2b591c38a66..ff5c963b4dc9ea86eaa0e81929c6abccba6abd6f 100644 (file)
@@ -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 *in, const __u8 *buffer, loff_t offset,
        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 *in, const __u8 *buffer, loff_t offset,
                           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.
index 2b5884715a0f9e6a218fd5a7ebc5a901d5e26d86..c1d447819970e7ccab5a81bc0e7b576ae807b233 100644 (file)
@@ -179,8 +179,14 @@ int nandmtd2_ReadChunkWithTagsFromNAND(yaffs_Device *dev, int chunkInNAND,
        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
index cb2a1629f2008e65a7efc176edc918cb712f14b5..6964ad18c0d567a04ddf404e4d5dcaf09e720a17 100644 (file)
@@ -43,7 +43,8 @@ int yaffs_ReadChunkWithTagsFromNAND(yaffs_Device *dev, int chunkInNAND,
        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);
        }
 
index 7a8397f0f0683a71f5678265b05d6807971ea20c..d962fca6b2dd3c034a468d12f952ca221e14135f 100644 (file)
 
 
 #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