JFFS2

From Wikipedia, the free encyclopedia

The Journalling Flash File System version 2 or JFFS2 is a log-structured file system for use in flash memory devices. It is the successor to JFFS, and will be superseded by JFFS3. JFFS2 has been included in the Linux kernel since the 2.4.10 release.

Contents

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, 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 algorithm in JFFS2 makes this mostly unnecessary.

As with JFFS, changes to files and directories are "logged" to flash in nodes, of which there are two types:

  • inodes: 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 runs in the background, turning dirty blocks into free blocks. It does this by copying valid nodes to the log head and skipping obsolete ones. That done, it erases the block and tags it with a special marker (to prevent confusion if power is lost during an erase operation).

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

  • All nodes must still be scanned at mount time. This is slow and is becoming an increasingly serious problem as flash devices scale upward into the gigabyte range.

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.