I'm newbie to JFFS2 file systems. I'm looking for a reference/article/paper on garbage collection algorithm used in JFFS2. It would be great if anyone steer me to that.
Thanks.
-Sam
The best technical description of JFFS2 is the original paper.
JFFS2 writes sequentially from the beginning of the device all the way to the end and then starts over again at the beginning. On this and subsequent passes, it erases blocks that were written on previous passes. It erases all of the dirty blocks and some fraction of the clean ones too (for wear levelling). Before erasing them, it writes new copies of everything in those blocks that's still needed. The rest of the contents of the block which isn't needed anymore (the garbage) goes away in the erase.