JFFS2
Encyclopedia
Journalling Flash File System version 2 or JFFS2 is a log-structured file system
Log-structured file system
A log-structured filesystem is a file system design first proposed in 1988 by John K. Ousterhout and Fred Douglis. Designed for high write throughput, all updates to data and metadata are written sequentially to a continuous stream, called a log...

 for use with flash memory
Flash memory
Flash memory is a non-volatile computer storage chip that can be electrically erased and reprogrammed. It was developed from EEPROM and must be erased in fairly large blocks before these can be rewritten with new data...

 devices. It is the successor to JFFS
JFFS
The Journaling Flash File System is a log-structured file system for use on NOR flash memory devices on the Linux operating system. It has been superseded by JFFS2.- Design :...

. JFFS2 has been included in the Linux kernel
Linux kernel
The Linux kernel is an operating system kernel used by the Linux family of Unix-like operating systems. It is one of the most prominent examples of free and open source software....

 since the 2.4.10 (2001-09-23) release. JFFS2 is also available for a couple of bootloaders like Das U-Boot
Das U-Boot
Das U-Boot is an open source, primary boot loader used in embedded devices. It is available for a number of different computer architectures, including PPC, ARM, MIPS, AVR32, x86, 68k, Nios, and MicroBlaze.- Supported File Systems :...

, Open Firmware
Open Firmware
Open Firmware, or OpenBoot in Sun Microsystems parlance, is a standard defining the interfaces of a computer firmware system, formerly endorsed by the Institute of Electrical and Electronics Engineers . It originated at Sun, and has been used by Sun, Apple, IBM, and most other non-x86 PCI chipset...

, the eCos
ECos
eCos is an open source, royalty-free, real-time operating system intended for embedded systems and applications which need only one process with multiple threads. It is designed to be customizable to precise application requirements of run-time performance and hardware needs...

 RTOS and the RedBoot
RedBoot
RedBoot is an open source application that uses the eCos real-time operating system Hardware Abstraction Layer to provide bootstrap firmware for embedded systems...

. Most prominently JFFS2 is used in OpenWrt
OpenWrt
OpenWrt is a Linux distribution primarily targeted at routing on embedded devices. It comprises a set of about 2000 software packages, installed and uninstalled via the opkg package management system. OpenWrt can be configured using the command-line interface of BusyBox ash, or the web interface...

.

At least three file systems have been developed as JFFS2 replacements; LogFS
LogFS
LogFS is a Linux log-structured and scalable flash file system, intended for use on large devices of flash memory. It is written by Jörn Engel and in part sponsored by the CE Linux Forum....

, UBIFS
UBIFS
The Unsorted Block Image File System is a successor to JFFS2, and competitor to LogFS, as a file system for use with raw flash memory media. Development began in earnest in 2007, with the first stable release made to Linux kernel 2.6.27 in October 2008.Note that UBIFS works on top of an Unsorted...

 and YAFFS
YAFFS
YAFFS was designed and written by Charles Manning, of Whitecliffs, New Zealand, for the company .Yaffs1 is the first version of this file system and works on NAND chips that have 512 byte pages + 16 byte spare areas. These older chips also generally allow 2 or 3 write cycles per page, which...

.

Features

JFFS2 introduced:
  • Support for NAND flash devices. This involved a considerable amount of work as NAND devices have a sequential I/O interface and cannot be memory-mapped for reading.
  • Hard links. This was not possible in JFFS because of limitations in the on-disk format.
  • Compression. Three algorithms are available: zlib
    Zlib
    zlib is a software library used for data compression. zlib was written by Jean-Loup Gailly and Mark Adler and is an abstraction of the DEFLATE compression algorithm used in their gzip file compression program. Zlib is also a crucial component of many software platforms including Linux, Mac OS X,...

    , rubin and rtime.
  • Better performance. JFFS treated the disk as a purely circular log. This generated a great deal of unnecessary I/O. The garbage collection
    Garbage collection (computer science)
    In computer science, garbage collection is a form of automatic memory management. The garbage collector, or just collector, attempts to reclaim garbage, or memory occupied by objects that are no longer in use by the program...

     algorithm
    Algorithm
    In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning...

     in JFFS2 makes this mostly unnecessary.

Design

As with JFFS, changes to files and directories are "logged" to flash in nodes, of which there are two types:
  • inode
    Inode
    In computing, an inode is a data structure on a traditional Unix-style file system such as UFS. An inode stores all the information about a regular file, directory, or other file system object, except its data and name....

    s
    : a header with file metadata, followed by a payload of file data (if any). Compressed payloads are limited to one page.
  • dirent nodes: directory entries each holding a name and an inode number. Hard links are represented as different names with the same inode number. The special inode number 0 represents an unlink.

As with JFFS, nodes start out as valid when they are created, and become obsolete when a newer version has been created elsewhere.

Unlike JFFS, however, there is no circular log. Instead, JFFS2 deals in blocks, 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. A clean block is one that contains only valid nodes. A dirty block contains at least one obsolete node. A free block contains no nodes.

The garbage collector
Garbage collection (computer science)
In computer science, garbage collection is a form of automatic memory management. The garbage collector, or just collector, attempts to reclaim garbage, or memory occupied by objects that are no longer in use by the program...

 runs in the background, turning dirty blocks into free blocks. It does this by copying valid nodes to a new block and skipping obsolete ones. That done, it erases the dirty block and tags it with a special marker designating it as a free block (to prevent confusion if power is lost during an erase operation).

To make wear-levelling
Wear levelling
Wear leveling is a technique for prolonging the service life of some kinds of erasable computer storage media, such as Flash memory used in solid-state drives and USB Flash drives...

 more even and prevent erasures from being too concentrated on mostly-static file systems, the garbage collector will occasionally also consume clean blocks.

Disadvantages

  • All nodes must still be scanned at mount
    Mount (computing)
    Mounting takes place before a computer can use any kind of storage device . The user or their operating system must make it accessible through the computer's file system. A user can access only files on mounted media.- Mount point :A mount point is a physical location in the partition used as a...

     time. This is slow and is becoming an increasingly serious problem as flash devices scale upward into the Gigabyte
    Gigabyte
    The gigabyte is a multiple of the unit byte for digital information storage. The prefix giga means 109 in the International System of Units , therefore 1 gigabyte is...

     range.
  • Writing many small blocks of data can even lead to negative compression rates, so it is essential for applications to use large write buffers.
  • There is no practical way to tell how much usable free space is left on a device since this depends both on how well additional data can be compressed, and the writing sequence.

See also

  • List of file systems
  • YAFFS
    YAFFS
    YAFFS was designed and written by Charles Manning, of Whitecliffs, New Zealand, for the company .Yaffs1 is the first version of this file system and works on NAND chips that have 512 byte pages + 16 byte spare areas. These older chips also generally allow 2 or 3 write cycles per page, which...

  • UBIFS
    UBIFS
    The Unsorted Block Image File System is a successor to JFFS2, and competitor to LogFS, as a file system for use with raw flash memory media. Development began in earnest in 2007, with the first stable release made to Linux kernel 2.6.27 in October 2008.Note that UBIFS works on top of an Unsorted...

  • LogFS
    LogFS
    LogFS is a Linux log-structured and scalable flash file system, intended for use on large devices of flash memory. It is written by Jörn Engel and in part sponsored by the CE Linux Forum....

  • ZFS
    ZFS
    In computing, ZFS is a combined file system and logical volume manager designed by Sun Microsystems. The features of ZFS include data integrity verification against data corruption modes , support for high storage capacities, integration of the concepts of filesystem and volume management,...

  • Btrfs
    Btrfs
    Btrfs is a GPL-licensed copy-on-write file system for Linux.Development began at Oracle Corporation in 2007....

  • NILFS
    NILFS
    NILFS is a log-structured file system implementation for Linux. It is being developed by Nippon Telegraph and Telephone Corporation CyberSpace Laboratories and released under the terms of the GNU General Public License .Version 2 of the filesystem, known as NILFS2, is included in Linux kernel...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK