From: Charles Manning Date: Thu, 14 Jun 2012 22:16:42 +0000 (+1200) Subject: yaffs: By default route all writes into the yaffs cache X-Git-Tag: aleph1-release~73^2~9 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=4b745e6080b0e0283e1e2f1de044760a8245e227;hp=f579840dc5fa33617b3c99bf184024373941066a yaffs: By default route all writes into the yaffs cache In the past only non-aligned or inband-tags writes were written into the internal cache. However the cache has some benefits with certain write patterns, so the default has been changed to always write into the cache. A control parameter has been added to bypass the cache for aligned writes. Signed-off-by: Charles Manning --- diff --git a/yaffs_guts.c b/yaffs_guts.c index 1602c4b..79568ee 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -3559,9 +3559,11 @@ int yaffs_do_file_wr(struct yaffs_obj *in, const u8 *buffer, loff_t offset, } if (n_copy != dev->data_bytes_per_chunk || + !dev->param.cache_bypass_aligned || dev->param.inband_tags) { /* An incomplete start or end chunk (or maybe both * start and end chunk), or we're using inband tags, + * or we're forcing writes through the cache, * so we want to use the cache buffers. */ if (dev->param.n_caches > 0) { diff --git a/yaffs_guts.h b/yaffs_guts.h index 1aefb85..f4fe475 100644 --- a/yaffs_guts.h +++ b/yaffs_guts.h @@ -520,7 +520,7 @@ struct yaffs_param { /* * Entry parameters set up way early. Yaffs sets up the rest. * The structure should be zeroed out before use so that unused - * and defualt values are zero. + * and default values are zero. */ int inband_tags; /* Use unband tags */ @@ -536,6 +536,10 @@ struct yaffs_param { int n_caches; /* If <= 0, then short op caching is disabled, * else the number of short op caches. */ + int cache_bypass_aligned; /* If non-zero then bypass the cache for + * aligned writes. + */ + int use_nand_ecc; /* Flag to decide whether or not to use * NAND driver ECC on data (yaffs1) */ int tags_9bytes; /* Use 9 byte tags */