Lines Matching +full:directory +full:- +full:based
2 WHAT IS Flash-Friendly File System (F2FS)?
5 NAND flash memory-based storage devices, such as SSD, eMMC, and SD cards, have
11 F2FS is a file system exploiting NAND flash memory-based storage devices, which
12 is based on Log-structured File System (LFS). The design has been focused on
16 Since a NAND flash memory-based storage device shows different characteristic
18 F2FS and its tools support various parameters not only for configuring on-disk
23 >> git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git
26 >> linux-f2fs-devel@lists.sourceforge.net
32 Log-structured File System (LFS)
33 --------------------------------
34 "A log-structured file system writes all modifications to disk sequentially in
35 a log-like structure, thereby speeding up both file writing and crash recovery.
41 implementation of a log-structured file system", ACM Trans. Computer Systems
45 ----------------------
54 [1] Bityutskiy, A. 2005. JFFS3 design issues. http://www.linux-mtd.infradead.org/
57 -----------------
58 Since LFS is based on out-of-place writes, it produces so many obsolete blocks
67 3. It checks the cross-reference between the data and its parent index structure.
79 ---------------
80 - Enlarge the random write area for better performance, but provide the high
82 - Align FS data structures to the operational units in FTL as best efforts
85 ----------------------
86 - Use a term, “node”, that represents inodes as well as various pointer blocks
87 - Introduce Node Address Table (NAT) containing the locations of all the “node”
91 -----------------
92 - Support a background cleaning process
93 - Support greedy and cost-benefit algorithms for victim selection policies
94 - Support multi-head logs for static/dynamic hot and cold data separation
95 - Introduce adaptive logging for efficient block allocation
109 disable_roll_forward Disable the roll-forward recovery routine
110 norecovery Disable the roll-forward recovery routine, mounted read-
111 only (i.e., -o ro,disable_roll_forward)
112 discard/nodiscard Enable/disable real-time discard in f2fs, if discard is
115 no_heap Disable heap-style segment allocation which finds free
132 directory entries can be written into inode block. The
148 extent_cache Enable an extent cache based on rb-tree, it can cache
152 noextent_cache Disable an extent cache based on rb-tree explicitly, see
188 prjjquota=<file> <quota file>: must be in root directory;
196 layer. This supports "off", "user-based", and
197 "fs-based". In "off" mode (default), f2fs does not pass
198 down hints. In "user-based" mode, f2fs tries to pass
199 down hints given by users. And in "fs-based" mode, f2fs
210 based on "posix", but doesn't issue flush command for
211 non-atomic files likewise "nobarrier" mount option.
223 - major file system information managed by f2fs currently
224 - average SIT information about whole segments
225 - current memory footprint consumed by f2fs.
232 /sys/fs/f2fs. Each mounted filesystem will have a directory in
233 /sys/fs/f2fs based on its device name (i.e., /sys/fs/f2fs/sda).
234 The files in each per-device directory are shown in table below.
237 (see also Documentation/ABI/testing/sysfs-fs-f2fs)
286 ipu_policy This parameter controls the policy of in-place
293 in-place-updates. The number indicates percentage
298 in-place-updates when F2FS_IPU_FSYNC mode is set.
302 in-place-updates.
309 dir_level This parameter controls the directory level to
310 support large directory. If a directory has a
330 3. Create a directory trying to mount
334 # mkfs.f2fs -l label /dev/block_device
335 # mount -t f2fs /dev/block_device /mnt/f2fs
338 ---------
340 which builds a basic on-disk layout.
343 -l [label] : Give a volume label, up to 512 unicode name.
344 -a [0 or 1] : Split start location of each area for heap-based allocation.
346 -o [int] : Set overprovision ratio in percent over volume size.
348 -s [int] : Set the number of segments per section.
350 -z [int] : Set the number of sections per zone.
352 -e [str] : Set basic extension list. e.g. "mp3,gif,mov"
353 -t [0 or 1] : Disable discard command or not.
357 ---------
358 The fsck.f2fs is a tool to check the consistency of an f2fs-formatted
359 partition, which examines whether the filesystem metadata and user-made data
360 are cross-referenced correctly or not.
364 -d debug level [default:0]
367 ---------
371 The dump.f2fs is used to debug on-disk data structures of the f2fs filesystem.
372 It shows on-disk inode information recognized by a given inode number, and is
377 -d debug level [default:0]
378 -i inode no (hex)
379 -s [SIT dump segno from #1~#2 (decimal), for all 0~-1]
380 -a [SSA dump segno from #1~#2 (decimal), for all 0~-1]
383 # dump.f2fs -i [ino] /dev/sdx
384 # dump.f2fs -s 0~-1 /dev/sdx (SIT dump)
385 # dump.f2fs -a 0~-1 /dev/sdx (SSA dump)
391 On-disk Layout
392 --------------
402 align with the zone size <-|
403 |-> align with the segment size
421 - Superblock (SB)
426 - Checkpoint (CP)
430 - Segment Information Table (SIT)
434 - Node Address Table (NAT)
438 - Segment Summary Area (SSA)
442 - Main Area
443 : It contains file and directory data including their indices.
445 In order to avoid misalignment between file system and flash-based storage, F2FS
454 ------------------------------
465 +--------+----------+---------+
467 +--------+----------+---------+
471 +-------+-------+--------+--------+--------+--------+
473 +-------+-------+--------+--------+--------+--------+
476 `----------------------------------------'
479 ---------------
492 |- data (923)
493 |- direct node (2)
494 | `- data (1018)
495 |- indirect node (2)
496 | `- direct node (1018)
497 | `- data (1018)
498 `- double indirect node (1)
499 `- indirect node (1018)
500 `- direct node (1018)
501 `- data (1018)
508 Directory Structure
509 -------------------
511 A directory entry occupies 11 bytes, which consists of the following attributes.
513 - hash hash value of the file name
514 - ino inode number
515 - len the length of file name
516 - type file type such as directory, symlink, etc
526 +--------------------------------+
528 +--------------------------------+
532 +--------+----------+----------+------------+
534 +--------+----------+----------+------------+
538 +------+------+-----+------+
540 +------+------+-----+------+
543 F2FS implements multi-level hash tables for directory structure. Each level has
547 ----------------------
551 ----------------------
555 level #1 | A(2B) - A(2B)
557 level #2 | A(2B) - A(2B) - A(2B) - A(2B)
559 level #N/2 | A(2B) - A(2B) - A(2B) - A(2B) - A(2B) - ... - A(2B)
561 level #N | A(4B) - A(4B) - A(4B) - A(4B) - A(4B) - ... - A(4B)
565 ,- 2, if n < MAX_DIR_HASH_DEPTH / 2,
567 `- 4, Otherwise
569 ,- 2^(n + dir_level),
572 `- 2^((MAX_DIR_HASH_DEPTH / 2) - 1),
575 When F2FS finds a file name in a directory, at first a hash value of the file
590 --------------> Dir <--------------
594 child - child [hole] - child
596 child - child - child [hole] - [hole] - child
603 ------------------------
608 - Hot node contains direct node blocks of directories.
609 - Warm node contains direct node blocks except hot node blocks.
610 - Cold node contains indirect node blocks
611 - Hot data contains dentry blocks
612 - Warm data contains data blocks except hot and cold data blocks
613 - Cold data contains multimedia data or migrated data blocks
615 LFS has two schemes for free space management: threaded log and copy-and-compac-
616 tion. The copy-and-compaction scheme which is known as cleaning, is well-suited
621 scheme where the copy-and-compaction scheme is adopted by default, but the
625 In order to align F2FS with underlying flash-based storage, F2FS allocates a
633 ----------------
635 F2FS does cleaning both on demand and in the background. On-demand cleaning is
640 F2FS supports two victim selection policies: greedy and cost-benefit algorithms.
642 of valid blocks. In the cost-benefit algorithm, F2FS selects a victim segment
645 algorithm for on-demand cleaner, while background cleaner adopts cost-benefit
652 Write-hint Policy
653 -----------------
657 2) whint_mode=user-based. F2FS tries to pass down hints given by
661 ---- ---- -----
669 -- buffered io
677 -- direct io
685 3) whint_mode=fs-based. F2FS passes down hints with its policy.
688 ---- ---- -----
696 -- buffered io
704 -- direct io