Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

JFFS2

From Wikipedia, the free encyclopedia
Log-structured file system for flash memory devices
Not to be confused withJFS2.
JFFS2
Developer(s)David Woodhouse
Full nameJournalling Flash File System version 2
IntroducedSeptember 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.

Features

[edit]

JFFS2 introduced:

  • Support forNAND 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. Five algorithms are available:zlib, rubin, lzma, rtime, andlzo.
  • Better performance. JFFS treated the disk as a purely circular log. This generated a great deal of unnecessary I/O. Thegarbage collectionalgorithm in JFFS2 makes this mostly unnecessary.

Design

[edit]

As with JFFS, changes to files and directories are "logged" to flash innodes, 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 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]

Disadvantages

[edit]

Due to its log-structured design, JFFS2's disadvantages include the following:[3]

  • All nodes must still be scanned atmount time. This is slow and is becoming an increasingly serious problem as flash devices scale upward into theterabyte range. To overcome this issue, theErase Block Summary (EBS) was introduced in version 2.6.15 of the Linux kernel. EBS is placed at the end of each block and updated upon each write to the block, summarizing the block's content; during mounts, EBS is read instead of scanning whole blocks.
  • 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

[edit]

References

[edit]
  1. ^"Memory Technology Device (MTD) Subsystem for Linux".www.linux-mtd.infradead.org. Retrieved2021-05-15.
  2. ^"The OpenWrt Flash Layout - OpenWrt Wiki".Wiki.openwrt.org. 18 January 2010. Retrieved2014-03-04.
  3. ^abcd"Software Profile: Journaling Flash File System, Version 2 (JFFS2)"(PDF). micron.com. 2011. Archived fromthe original(PDF) on 2014-03-07. Retrieved2014-03-04.

External links

[edit]
Disk and
non-rotating
Optical disc
Flash memory andSSD
host-sidewear leveling
Distributed parallel
NAS
Specialized
Pseudo
Encrypted
Types
Features
Access control
Interfaces
Lists
Layouts
Retrieved from "https://en.wikipedia.org/w/index.php?title=JFFS2&oldid=1336477121"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp