Mercurial > flash_v2
changeset 1620:d04fae1f5cde
* src/build.c: JFFS2 can now be used as a write-once, read many mode
for really small flash disks, e.g. configuration parameters.
| author | jlarmour |
|---|---|
| date | Thu, 29 Apr 2004 07:16:10 +0000 |
| parents | 2aabaeffc161 |
| children | 26840b464238 |
| files | packages/fs/jffs2/current/ChangeLog packages/fs/jffs2/current/src/build.c |
| diffstat | 2 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/fs/jffs2/current/ChangeLog +++ b/packages/fs/jffs2/current/ChangeLog @@ -1,3 +1,8 @@ +2004-04-19 Oyvind Harboe <oyvind.harboe@zylin.com> + + * src/build.c: JFFS2 can now be used as a write-once, read many mode + for really small flash disks, e.g. configuration parameters. + 2004-04-21 Gary Thomas <gary@mlbassoc.com> * src/fs-ecos.c: Merge from public MTD - verify file position
--- a/packages/fs/jffs2/current/src/build.c +++ b/packages/fs/jffs2/current/src/build.c @@ -259,6 +259,14 @@ static void jffs2_calc_trigger_levels(st c->resv_blocks_write = c->resv_blocks_deletion + (size / c->sector_size); + // If the flash disk is smaller than resv_blocks_write, then we + // allow writing to the disk anyway. The flash disk is then most likely + // being used as write once - read many medimum, e.g. configuration of + // static paramters. + if (c->resv_blocks_write * c->sector_size > c->flash_size) { + c->resv_blocks_write = 0; + } + /* When do we let the GC thread run in the background */ c->resv_blocks_gctrigger = c->resv_blocks_write + 1;
