JFFS2 determine writing state

Jamie Lokier jamie at shareable.org
Tue Jan 15 12:35:10 EST 2008


Jörn Engel wrote:
> On Tue, 15 January 2008 14:08:00 +0000, Jamie Lokier wrote:
> > But the particular fs behaviour is relevant the other way around: I
> > have a program which calls open/write/close with small writes
> > moderately often (because it calls another program which actually
> > operates on the file).
> > 
> > If JFFS2 commits pending writes on every close, I should change things
> > to keep the file open between writes so they are coalesced and faster,
> > when I don't need the individual writes to be committed separately.
> 
> JFFS2 also commits on every write.  So you need userspace caching if you
> want to coalesce things.  fwrite might be enough for that...

Oh, ok, I thought it at least merged things in the page cache like
most other filesystems.  It seems it's more like O_DSYNC - or more
like O_SYNC (commits metadata changed for every write too)?

Is there a particular advantage, in terms of flash overhead,
compression, or mount/gc times, to writing blocks with a particular
size and alignment, such as 4k size and 4k offset-alignment-in-file?

Also, does LogFS (which I want to try later) have similar
characteristics?

> > When I do need the data committed I can use fsync of course.
> 
> ...as long as you also fflush (or fclose) before fsync.

Sure.  Thanks for your response.

-- Jamie



More information about the linux-mtd mailing list