YAFFS

YAFFS
Developer(s)Charles Manning
Full nameYet Another Flash File System
Other
Supported
operating systems
Android, Firefox OS, Linux, Windows CE, pSOS, RTEMS, eCos, ThreadX, LCOS

YAFFS (Yet Another Flash File System) is a file system designed and written by Charles Manning for the company Aleph One.

YAFFS1 was the first version of this file system and was designed for the then-current NAND chips with 512 byte page size (+ 16 byte spare (OOB; Out-Of-Band) area). Work started in 2002, and it was first released later that year. The initial work was sponsored by Toby Churchill Ltd, and Brightstar Engineering.

These older chips also generally allow 2 or 3 write cycles per page.[1] YAFFS takes advantage of this: dirty pages are marked by writing to a specific spare area byte. Newer NAND flash chips have larger pages, first 2K pages (+ 64 bytes OOB), later 4K, with stricter write requirements. Each page within an erase block (128 kilobytes) must be written to in sequential order, and each page must be written only once.[citation needed]

Designing a storage system that enforces a "write once rule" ("write once property") has several advantages.[2]

YAFFS2 was designed to accommodate these newer chips. It was based on the YAFFS1 source code, with the major difference being that internal structures are not fixed to assume 512 byte sizing, and a block sequence number is placed on each written page. In this way older pages can be logically overwritten without violating the "write once" rule. It was released in late 2003.

YAFFS is a robust log-structured file system that holds data integrity as a high priority. A secondary YAFFS goal is high performance. YAFFS will typically outperform most alternatives.[3] It is also designed to be portable and has been used on Linux, WinCE, pSOS, RTEMS, eCos, ThreadX, and various special-purpose OSes. A variant 'YAFFS/Direct' is used in situations where there is no OS, embedded OSes or bootloaders: it has the same core filesystem but simpler interfacing to both the higher and lower level code and the NAND flash hardware.

The YAFFS codebase is licensed both under the GPL and under per-product licenses available from Aleph One.

YAFFS is locked on a per-partition basis at a high level, allowing only one thread to write at any given time.[4]

  1. ^ Erasing a flash erase block sets all of its bits to 1s, and writing a write block (smaller than an erase block, but possibly bigger than a filesystem block) sets selected bits to 0s. One or two further writes to the block could be sustained if the bits being written to 0 were previously 1s in the write block. Writing a 0 to a bit which was already 0 risked making the 0 "stick", i.e. multiple erases could be needed to return the bit to a 1.[citation needed] Needless to say, this multiple-write practice was not generally tested and guaranteed by flash vendors, and cannot work at all on non-SLC flash technologies.
  2. ^ Jack B. Dennis; Guang R. Gao; and Vivek Sarkar. "Collaborative Research: Programming Models and Storage System for High Performance Computation with Many-Core Processors". p. 4
  3. ^ "Flash filesystem benchmarks Linux 3.1".
  4. ^ "How Yaffs works | Yaffs – A Flash File System for embedded use". yaffs.net. Retrieved 2024-03-18.