atomic file operations
Artem B. Bityuckiy
dedekind at infradead.org
Thu Mar 24 14:32:51 EST 2005
> Artem, when figuring out if the write goes over the page boudary you did
> anything about CRC and other non-user data.. Should it be taken into
> too or am I missing something?
Well, page boundaries aren't problem. We want a write operation which goes
to flash a one node.
There are two points of splitting:
1. Linux page cache splits data on PAGE_SIZE chunks.
2. jffs2_write_inode_range may do further split. This is what I missed
Yes, jffs2_write_inode_range will not split if the node to write is fewer
then sizeof(struct jffs2_raw_inode) + JFFS2_MIN_DATA_LEN.
So, sizeof(struct jffs2_raw_inode) includes all the "anything about CRC
and other non-user data" and you may write JFFS2_MIN_DATA_LEN bytes
So, I'll write the rules again:
1. write only 0- JFFS2_MIN_DATA_LEN bytes;
2. do not overlap n*PAGE_SIZE borders (n is 1,2, ...)
3. do fsync after write
Artem B. Bityuckiy,
More information about the linux-mtd