aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/wbuf.c
diff options
context:
space:
mode:
authorFerenc Havasi <havasi@inf.u-szeged.hu>2005-09-07 04:35:26 -0400
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-11-06 15:29:48 -0500
commite631ddba588783edd521c5a89f7b2902772fb691 (patch)
treee25f322ee498b344f058ce4a40060baa22a5f105 /fs/jffs2/wbuf.c
parent15017876751e4c2d786ba95920618359fe2b4f0a (diff)
[JFFS2] Add erase block summary support (mount time improvement)
The goal of summary is to speed up the mount time. Erase block summary (EBS) stores summary information at the end of every (closed) erase block. It is no longer necessary to scan all nodes separetly (and read all pages of them) just read this "small" summary, where every information is stored which is needed at mount time. This summary information is stored in a JFFS2_FEATURE_RWCOMPAT_DELETE. During the mount process if there is no summary info the orignal scan process will be executed. EBS works with NAND and NOR flashes, too. There is a user space tool called sumtool to generate this summary information for a JFFS2 image. Signed-off-by: Ferenc Havasi <havasi@inf.u-szeged.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/jffs2/wbuf.c')
-rw-r--r--fs/jffs2/wbuf.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
index 8c06d3a2b17d..86860dbc670c 100644
--- a/fs/jffs2/wbuf.c
+++ b/fs/jffs2/wbuf.c
@@ -9,7 +9,7 @@
9 * 9 *
10 * For licensing information, see the file 'LICENCE' in this directory. 10 * For licensing information, see the file 'LICENCE' in this directory.
11 * 11 *
12 * $Id: wbuf.c,v 1.97 2005/08/06 04:51:30 nico Exp $ 12 * $Id: wbuf.c,v 1.98 2005/09/07 08:34:55 havasi Exp $
13 * 13 *
14 */ 14 */
15 15
@@ -265,7 +265,7 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c)
265 265
266 266
267 /* ... and get an allocation of space from a shiny new block instead */ 267 /* ... and get an allocation of space from a shiny new block instead */
268 ret = jffs2_reserve_space_gc(c, end-start, &ofs, &len); 268 ret = jffs2_reserve_space_gc(c, end-start, &ofs, &len, JFFS2_SUMMARY_NOSUM_SIZE);
269 if (ret) { 269 if (ret) {
270 printk(KERN_WARNING "Failed to allocate space for wbuf recovery. Data loss ensues.\n"); 270 printk(KERN_WARNING "Failed to allocate space for wbuf recovery. Data loss ensues.\n");
271 kfree(buf); 271 kfree(buf);
@@ -836,6 +836,12 @@ int jffs2_flash_writev(struct jffs2_sb_info *c, const struct kvec *invecs, unsig
836alldone: 836alldone:
837 *retlen = donelen; 837 *retlen = donelen;
838 838
839 if (jffs2_sum_active()) {
840 int res = jffs2_sum_add_kvec(c, invecs, count, (uint32_t) to);
841 if (res)
842 return res;
843 }
844
839 if (c->wbuf_len && ino) 845 if (c->wbuf_len && ino)
840 jffs2_wbuf_dirties_inode(c, ino); 846 jffs2_wbuf_dirties_inode(c, ino);
841 847
@@ -855,7 +861,7 @@ int jffs2_flash_write(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *r
855 struct kvec vecs[1]; 861 struct kvec vecs[1];
856 862
857 if (!jffs2_is_writebuffered(c)) 863 if (!jffs2_is_writebuffered(c))
858 return c->mtd->write(c->mtd, ofs, len, retlen, buf); 864 return jffs2_flash_direct_write(c, ofs, len, retlen, buf);
859 865
860 vecs[0].iov_base = (unsigned char *) buf; 866 vecs[0].iov_base = (unsigned char *) buf;
861 vecs[0].iov_len = len; 867 vecs[0].iov_len = len;