From: Charles Manning Date: Tue, 27 Apr 2010 02:06:38 +0000 (+1200) Subject: yaffs: Integrate Android tree differences X-Git-Tag: pre-name-change~75 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=4778ade2698a2de536594ee9cbf32db58346b59c 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 --- diff --git a/Kconfig b/Kconfig index 8c218e3..d4363ed 100644 --- 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" diff --git a/Makefile b/Makefile index f297efa..919afc0 100644 --- 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. diff --git a/yaffs_checkptrw.h b/yaffs_checkptrw.h index 3350d1e..881c365 100644 --- a/yaffs_checkptrw.h +++ b/yaffs_checkptrw.h @@ -32,4 +32,3 @@ int yaffs_CheckpointInvalidateStream(yaffs_Device *dev); #endif - diff --git a/yaffs_guts.c b/yaffs_guts.c index d77ee47..ff5c963 100644 --- 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 *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. diff --git a/yaffs_mtdif2.c b/yaffs_mtdif2.c index 2b58847..c1d4478 100644 --- a/yaffs_mtdif2.c +++ b/yaffs_mtdif2.c @@ -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 diff --git a/yaffs_nand.c b/yaffs_nand.c index cb2a162..6964ad1 100644 --- a/yaffs_nand.c +++ b/yaffs_nand.c @@ -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); } diff --git a/yportenv.h b/yportenv.h index 7a8397f..d962fca 100644 --- 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