From 6db5aca55acb7c8af07c8ec90ba8dd9085ab0895 Mon Sep 17 00:00:00 2001 From: Charles Manning Date: Thu, 29 Apr 2010 13:40:28 +1200 Subject: [PATCH] yaffs: Improve debug chunk erased checking, change refreshPeriod Normalise macro to YAFFS_CONFIG_ALWAYS_CHECK_CHUNK_ERASED. This reduces performance so output kernel message warning this is enabled. Change refreshPeriod to make it much slower. Signed-off-by: Charles Manning --- moduleconfig.h | 7 ++++--- yaffs_fs.c | 10 +++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/moduleconfig.h b/moduleconfig.h index 89eeec8..e8efd67 100644 --- a/moduleconfig.h +++ b/moduleconfig.h @@ -38,9 +38,10 @@ /* CONFIG_YAFFS_DOES_ECC is set */ /* #define CONFIG_YAFFS_ECC_WRONG_ORDER */ -/* Default: Selected */ -/* Meaning: Disables testing whether chunks are erased before writing to them*/ -#define CONFIG_YAFFS_DISABLE_CHUNK_ERASED_CHECK +/* Default: Not selected */ +/* Meaning: Always test whether chunks are erased before writing to them. + Use during mtd debugging and init. */ +/* #define CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED */ /* Default: Not Selected */ /* Meaning: At mount automatically empty all files from lost and found. */ diff --git a/yaffs_fs.c b/yaffs_fs.c index 07ff66e..6eb356c 100644 --- a/yaffs_fs.c +++ b/yaffs_fs.c @@ -2648,7 +2648,7 @@ static struct super_block *yaffs_internal_read_super(int yaffsVersion, #ifdef CONFIG_YAFFS_DISABLE_BLOCK_REFRESHING param->refreshPeriod = 0; #else - param->refreshPeriod = 100; + param->refreshPeriod = 500; #endif if(options.empty_lost_and_found_overridden) @@ -3178,6 +3178,14 @@ static int __init init_yaffs_fs(void) T(YAFFS_TRACE_ALWAYS, (TSTR("yaffs built " __DATE__ " " __TIME__ " Installing. \n"))); +#ifdef CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED + T(YAFFS_TRACE_ALWAYS, + (TSTR(" \n\n\n\nYAFFS-WARNING CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED selected.\n\n\n\n"))); +#endif + + + + init_MUTEX(&yaffs_context_lock); /* Install the proc_fs entries */ -- 2.30.2