diff options
author | Ferenc Havasi <havasi@inf.u-szeged.hu> | 2005-09-07 04:35:26 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-11-06 15:29:48 -0500 |
commit | e631ddba588783edd521c5a89f7b2902772fb691 (patch) | |
tree | e25f322ee498b344f058ce4a40060baa22a5f105 /fs/jffs2/os-linux.h | |
parent | 15017876751e4c2d786ba95920618359fe2b4f0a (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/os-linux.h')
-rw-r--r-- | fs/jffs2/os-linux.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index c3c1619fb137..e026888cf1cb 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * | 7 | * |
8 | * For licensing information, see the file 'LICENCE' in this directory. | 8 | * For licensing information, see the file 'LICENCE' in this directory. |
9 | * | 9 | * |
10 | * $Id: os-linux.h,v 1.60 2005/08/06 04:51:30 nico Exp $ | 10 | * $Id: os-linux.h,v 1.61 2005/09/07 08:34:54 havasi Exp $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
@@ -67,12 +67,18 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f) | |||
67 | 67 | ||
68 | #ifndef CONFIG_JFFS2_FS_WRITEBUFFER | 68 | #ifndef CONFIG_JFFS2_FS_WRITEBUFFER |
69 | #define SECTOR_ADDR(x) ( ((unsigned long)(x) & ~(c->sector_size-1)) ) | 69 | #define SECTOR_ADDR(x) ( ((unsigned long)(x) & ~(c->sector_size-1)) ) |
70 | |||
71 | #ifdef CONFIG_JFFS2_SUMMARY | ||
72 | #define jffs2_can_mark_obsolete(c) (0) | ||
73 | #else | ||
70 | #define jffs2_can_mark_obsolete(c) (1) | 74 | #define jffs2_can_mark_obsolete(c) (1) |
75 | #endif | ||
76 | |||
71 | #define jffs2_is_writebuffered(c) (0) | 77 | #define jffs2_is_writebuffered(c) (0) |
72 | #define jffs2_cleanmarker_oob(c) (0) | 78 | #define jffs2_cleanmarker_oob(c) (0) |
73 | #define jffs2_write_nand_cleanmarker(c,jeb) (-EIO) | 79 | #define jffs2_write_nand_cleanmarker(c,jeb) (-EIO) |
74 | 80 | ||
75 | #define jffs2_flash_write(c, ofs, len, retlen, buf) ((c)->mtd->write((c)->mtd, ofs, len, retlen, buf)) | 81 | #define jffs2_flash_write(c, ofs, len, retlen, buf) jffs2_flash_direct_write(c, ofs, len, retlen, buf) |
76 | #define jffs2_flash_read(c, ofs, len, retlen, buf) ((c)->mtd->read((c)->mtd, ofs, len, retlen, buf)) | 82 | #define jffs2_flash_read(c, ofs, len, retlen, buf) ((c)->mtd->read((c)->mtd, ofs, len, retlen, buf)) |
77 | #define jffs2_flush_wbuf_pad(c) ({ (void)(c), 0; }) | 83 | #define jffs2_flush_wbuf_pad(c) ({ (void)(c), 0; }) |
78 | #define jffs2_flush_wbuf_gc(c, i) ({ (void)(c), (void) i, 0; }) | 84 | #define jffs2_flush_wbuf_gc(c, i) ({ (void)(c), (void) i, 0; }) |
@@ -97,9 +103,15 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f) | |||
97 | 103 | ||
98 | #define jffs2_is_writebuffered(c) (c->wbuf != NULL) | 104 | #define jffs2_is_writebuffered(c) (c->wbuf != NULL) |
99 | #define SECTOR_ADDR(x) ( ((unsigned long)(x) / (unsigned long)(c->sector_size)) * c->sector_size ) | 105 | #define SECTOR_ADDR(x) ( ((unsigned long)(x) / (unsigned long)(c->sector_size)) * c->sector_size ) |
106 | |||
107 | #ifdef CONFIG_JFFS2_SUMMARY | ||
108 | #define jffs2_can_mark_obsolete(c) (0) | ||
109 | #else | ||
100 | #define jffs2_can_mark_obsolete(c) \ | 110 | #define jffs2_can_mark_obsolete(c) \ |
101 | ((c->mtd->type == MTD_NORFLASH && !(c->mtd->flags & (MTD_ECC|MTD_PROGRAM_REGIONS))) || \ | 111 | ((c->mtd->type == MTD_NORFLASH && !(c->mtd->flags & (MTD_ECC|MTD_PROGRAM_REGIONS))) || \ |
102 | c->mtd->type == MTD_RAM) | 112 | c->mtd->type == MTD_RAM) |
113 | #endif | ||
114 | |||
103 | #define jffs2_cleanmarker_oob(c) (c->mtd->type == MTD_NANDFLASH) | 115 | #define jffs2_cleanmarker_oob(c) (c->mtd->type == MTD_NANDFLASH) |
104 | 116 | ||
105 | #define jffs2_flash_write_oob(c, ofs, len, retlen, buf) ((c)->mtd->write_oob((c)->mtd, ofs, len, retlen, buf)) | 117 | #define jffs2_flash_write_oob(c, ofs, len, retlen, buf) ((c)->mtd->write_oob((c)->mtd, ofs, len, retlen, buf)) |
@@ -192,7 +204,8 @@ void jffs2_flash_cleanup(struct jffs2_sb_info *c); | |||
192 | /* writev.c */ | 204 | /* writev.c */ |
193 | int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs, | 205 | int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs, |
194 | unsigned long count, loff_t to, size_t *retlen); | 206 | unsigned long count, loff_t to, size_t *retlen); |
195 | 207 | int jffs2_flash_direct_write(struct jffs2_sb_info *c, loff_t ofs, size_t len, | |
208 | size_t *retlen, const u_char *buf); | ||
196 | 209 | ||
197 | #endif /* __JFFS2_OS_LINUX_H__ */ | 210 | #endif /* __JFFS2_OS_LINUX_H__ */ |
198 | 211 | ||