![]() | This article includes alist of references,related reading, orexternal links,but its sources remain unclear because it lacksinline citations. Please helpimprove this article byintroducing more precise citations.(August 2020) (Learn how and when to remove this message) |
Developer(s) | Axis Communications |
---|---|
Full name | Journaling Flash File System |
Other | |
Supported operating systems | Linux |
TheJournaling Flash File System (orJFFS) is alog-structured file system for use on NORflash memory devices on theLinux operating system. It has been superseded byJFFS2.
Flash memory (specificallyNOR flash) must be erased prior to writing. The erase process has several limitations:
These constraints combine to produce a profound asymmetry between patterns of read and write access to flash memory. In contrast, magnetic hard disk drives offer nearly symmetrical read and write access: read speed and write speed are nearly identical (as both are constrained by the rate at which the disk spins), it is possible to both read and write small blocks or sectors (typically 512 or4096 bytes), and there is no practical limit to the number of times magnetic media can be written and rewritten.
Traditional file systems, such asext2 orFAT which were designed for use on magnetic media typically update their data structures in-place, with data structures like inodes and directories updated on-disk after every modification. This concentrated lack of wear-levelling makes conventional file systems unsuitable for read-write use on flash devices.
JFFS enforceswear levelling by treating the flash device as a circular log. All changes to files and directories are written to the tail of the log innodes. In each node, a header containing metadata is written first, followed by file data, if any. Nodes are chained together with offset pointers in the header. Nodes start out asvalid and then becomeobsolete when a newer version of them is created.
The free space remaining in the file system is the gap between the log's tail and its head. When this runs low, agarbage collector copies valid nodes from the head to the tail and skips obsolete ones, thus reclaiming space.