| Developer(s) | David Woodhouse |
|---|---|
| Full name | Journalling Flash File System version 2 |
| Introduced | September 23, 2001 (2001-09-23) withLinux 2.4.10 |
| Features | |
| Transparent compression | zlib, rubin and rtime |
| Other | |
| Supported operating systems | Linux |
Journalling Flash File System version 2 orJFFS2 is alog-structured file system for use withflash memory devices.[1] It is the successor toJFFS. JFFS2 has been included into theLinux kernel since September 23, 2001, when it was merged into theLinux kernel mainline as part of the kernel version 2.4.10 release. JFFS2 is also available for a fewbootloaders, likeDas U-Boot,Open Firmware, theeCos RTOS, theRTEMS RTOS, and theRedBoot. Most prominent usage of the JFFS2 comes fromOpenWrt.[2]
At least three file systems have been developed as JFFS2 replacements:LogFS,UBIFS, andYAFFS.
JFFS2 introduced:
As with JFFS, changes to files and directories are "logged" to flash innodes, of which there are two types:
As with JFFS, nodes start out asvalid when they are created, and becomeobsolete when a newer version has been created elsewhere.
Unlike JFFS, however, there is no circular log. Instead, JFFS2 deals inblocks, a unit the same size as the erase segment of the flash medium. Blocks are filled, one at a time, with nodes from bottom up. Aclean block is one that contains onlyvalid nodes. Adirty block contains at least oneobsolete node. Afree block contains no nodes.[3]
Thegarbage collector runs in the background, turningdirty blocks intofree blocks. It does this by copyingvalid nodes to a new block and skippingobsolete ones. That done, it erases thedirty block and tags it with a special marker designating it as afree block (to prevent confusion if power is lost during an erase operation).[3]
To makewear-levelling more even and prevent erasures from being too concentrated on mostly-static file systems, the garbage collector will occasionally also consumeclean blocks.[3]
Due to its log-structured design, JFFS2's disadvantages include the following:[3]