mkfs.jffs2.c rework

Joakim Tjernlund joakim.tjernlund at lumentis.se
Mon Nov 25 11:18:55 EST 2002


> 
> > 
> > Also, could we have an option to write cleanmarkers to the beginning of 
> > each block?
> > 
> > --
> > dwmw2
> 
> Here is a patch to add cleanmarkers and some minor bugfix:
> Here is what I would use as a comment:
> --
> Added support for adding cleanmarkers to start of every eraseblock.
> --no-cleanmarkers disables it.
> --cleanmarker=SIZE changes the cleanmarker size.
> 
> Clean up hardcoded 16 to sizeof(ffbuf).
> Added missing pad_block_if_less_than() in output_reg().
> --
> Please apply if it looks ok.
> /Johan

Hi All

I had a quick look, here is my comments:

I think this:
+	cleanmarker.totlen =   cpu_to_target32(cleanmarker_size);
+	cleanmarker.hdr_crc = cpu_to_target32(crc32(0, &cleanmarker, sizeof(struct jffs2_unknown_node)-4));

should be:
+	cleanmarker.totlen =   cpu_to_target32(cleanmarker_size);
+	cleanmarker.hdr_crc = cpu_to_target32(crc32(0, &cleanmarker, cleanmarker_size -4));


If my memory serves me correct, I think the semantics of the clean marker has changed somewhat.
A clean erase block with only a clean maker on it will have the ACCURATE bit set, but once you
write to it you should clear the ACCURATE bit. This is an optimization that enables JFFS2 to
avoid scanning empty erase blocks.

 Jocke






More information about the linux-mtd mailing list