summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorGary King <gking@nvidia.com>2009-12-07 20:25:01 -0800
committerGary King <gking@nvidia.com>2010-05-16 18:54:05 -0700
commit7b415930da2505d4d2c0b76329215298ff3e6189 (patch)
tree1da0fc4f84f4dad6c7df918b7f836d0ee6e51af0 /fs
parent65a1a586adb5705d3b1dd8e2ad97e53985cc468c (diff)
yaffs: add TAG_NO_ECC Kconfig
on architectures which support ECC in hardware, reserve the 8B of OOB area normally consumed by the YAFFS2 tag area ECC for use by the architecture
Diffstat (limited to 'fs')
-rw-r--r--fs/yaffs2/Kconfig20
-rw-r--r--fs/yaffs2/yaffs_guts.c3
-rw-r--r--fs/yaffs2/yaffs_packedtags2.h2
3 files changed, 24 insertions, 1 deletions
diff --git a/fs/yaffs2/Kconfig b/fs/yaffs2/Kconfig
index 85844504057c..20f3991af19b 100644
--- a/fs/yaffs2/Kconfig
+++ b/fs/yaffs2/Kconfig
@@ -126,6 +126,26 @@ config YAFFS_DISABLE_WIDE_TNODES
If unsure, say N.
+config YAFFS2_TAG_NO_ECC
+ bool "Do not include the ECC data structure in packed tags"
+ depends on YAFFS_YAFFS2 && !YAFFS_DOES_ECC
+ default n
+ help
+ This makes the packedtags structure in yaffs2 not contain the
+ ECC descriptor. This saves 8 bytes in the OOB on systems with HW ECC.
+
+ Note: Care must be taken to ensure that a kernel with this option
+ does not attempt to mount an existing file system in flash that was
+ created with the larger tag. If the HW performs error-checking on the
+ tag area, it will fail and the file system could be rendered
+ unmountable.
+
+ If you will be mounting a brand new filesystem and the tools have
+ written the correct OOB data, it is recommended to say 'Y' here.
+
+ If unsure, say N.
+
+
config YAFFS_ALWAYS_CHECK_CHUNK_ERASED
bool "Force chunk erase check"
depends on YAFFS_FS
diff --git a/fs/yaffs2/yaffs_guts.c b/fs/yaffs2/yaffs_guts.c
index 968223eb3e31..8823d2b4d134 100644
--- a/fs/yaffs2/yaffs_guts.c
+++ b/fs/yaffs2/yaffs_guts.c
@@ -6331,13 +6331,14 @@ static int yaffs_ScanBackwards(yaffs_Device *dev)
dev->nFreeChunks++;
+#if !defined(CONFIG_YAFFS2_TAG_NO_ECC) && !defined(CONFIG_YAFFS_DOES_ECC)
} else if (tags.eccResult == YAFFS_ECC_RESULT_UNFIXED) {
T(YAFFS_TRACE_SCAN,
(TSTR(" Unfixed ECC in chunk(%d:%d), chunk ignored"TENDSTR),
blk, c));
dev->nFreeChunks++;
-
+#endif
} else if (tags.chunkId > 0) {
/* chunkId > 0 so it is a data chunk... */
unsigned int endpos;
diff --git a/fs/yaffs2/yaffs_packedtags2.h b/fs/yaffs2/yaffs_packedtags2.h
index ec30f843bcbd..86b0772e64de 100644
--- a/fs/yaffs2/yaffs_packedtags2.h
+++ b/fs/yaffs2/yaffs_packedtags2.h
@@ -30,7 +30,9 @@ typedef struct {
typedef struct {
yaffs_PackedTags2TagsPart t;
+#ifndef CONFIG_YAFFS2_TAG_NO_ECC
yaffs_ECCOther ecc;
+#endif
} yaffs_PackedTags2;
/* Full packed tags with ECC, used for oob tags */