write buffer for MTD devices?

Josh Boyer jwboyer at linux.vnet.ibm.com
Mon Jul 9 09:18:54 EDT 2007


On Thu, 2007-07-05 at 13:36 +0900, Seongsu Lee wrote:
> Hi,
> 
> You know that block devices such as hard disk has write buffer
> in hard disk itself to speed up the write performance.
> (The write buffer speed up when it works in write-back mode.)
> 
> My questions are: (only for NAND flash memory)
> 
> 1) Then, does MTD devices has write buffer in device itself?

The mtdblock driver does.  It caches one eraseblock.  JFFS2 also has a
write buffer.  Other than that, no.

> 2) If ret->mtd->write() returns OK, is the data sent by user
>    successfully written on flash memory media? (not cache or
>    buffer)

Depends.  If the write is being done to an mtdblock, then it is written
to the cache.  If it's being done to a "real" device, then it should be
written to flash.

> Any comments, related matrials or URLs are needed.

It's all in the code.

josh




More information about the linux-mtd mailing list