writing to jffs2 is so slow?

David Woodhouse dwmw2 at infradead.org
Fri Sep 6 14:54:15 EDT 2002


xjin at redswitch.com said:
> > Try eraseall from the utils.
> > With that, jffs2 just writes the erase markers to flash, 12 bytes per
> > erase block.

No, JFFS2 cannot trust that 'empty' blocks really have been properly 
erased, and must erase them again, writing a 'cleanmarker' node to them 
when the erase is complete.

> Well, that's just what I did. Then making a first directory takes 2
> minutes. 

JFFS2 is busy erasing every block on the file system. You have to wait 
until it's done before you can write.

Hacking the 'eraseall' program so it writes a 'cleanmarker' node to the 
beginning of every block erased is left as an exercise for the reader.

Other possibilities include a mount time option to tell JFFS2 that it 
should trust the flash and not re-erase the blocks, and/or changing the 
jffs2_write_super()/jffs2_erase_pending_blocks() to only erase a few blocks 
at a time, so you only have to wait for a few blocks to be erased, not the 
whole flash.


--
dwmw2






More information about the linux-mtd mailing list