[f2fs] Enable mount options and internal features

The configurable options are as below.
- discard
- # of active logs
- cold data separation based on file extension

TODO: noheap can be turned off after gc impl.

Test: fx test f2fs-unittest fs-tests large-fs-tests

Change-Id: I01ad30709c1fd3da24113f7630f5d1fa41a65ca9
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/f2fs/+/543303
Reviewed-by: Brett Wilson <brettw@google.com>
22 files changed
tree: 8ef941f52dd2acd8272fb280e466f54e4955697b
  1. patches/
  2. test/
  3. test_files/
  4. third_party/
  5. tools/
  6. AUTHORS
  7. bcache.cc
  8. bcache.h
  9. BUILD.gn
  10. checkpoint.cc
  11. CONTRIBUTING.md
  12. data.cc
  13. dir.cc
  14. dir.h
  15. dir_hash.cc
  16. f2fs.cc
  17. f2fs.h
  18. f2fs_internal.h
  19. f2fs_layout.h
  20. f2fs_lib.h
  21. f2fs_types.h
  22. file.cc
  23. file.h
  24. gc.cc
  25. LICENSE
  26. mkfs.cc
  27. mkfs.h
  28. mount.cc
  29. mount.h
  30. namei.cc
  31. namestring.h
  32. node.cc
  33. node.h
  34. PATENTS
  35. README.md
  36. recovery.cc
  37. segment.cc
  38. segment.h
  39. super.cc
  40. vnode.cc
  41. vnode.h
README.md

What is F2FS?

F2FS is the most commonly used log-structured file system in Linux. It supports flash-friendly features such as adaptive logging, multi-head logging, fsync acceleration, and node address translation. For more information see: https://www.usenix.org/conference/fast15/technical-sessions/presentation/lee

Major Release

1st release (Apr-06-2021)

  • Features: mkfs, mount/umount, read, write, rmdir, mkdir, rename, fsync, lseek, link, unlink
  • Remarks
  • Fuchsia base code ; Thu Mar 11 08:53:24 2021 Prashanth Swaminathan,76a08ad1474 [speak] Migrate to new component templates
  • There is no cache. Every request is handled as a synchronous operation.
  • fsync() triggers checkpointing
  • lock granularity: file operation
  • LFS is used for block allocation by default, and IPU is forced when the number of free sections is below 50%.
  • no background/foreground gc
  • disable the roll-forward recovery
  • 6 active logs
  • disable the ext-identify feature
  • block allocation: LFS, IPU
  • fsck do nothing, but it returns true
  • no discard

2nd release (May-28-2021)

  • Features: truncate, ssr, fsync, recovery
  • Remarks
  • Fuchsia base code ; Thu May 20 07:25:45 2021 Yilong Li, 02c0dfff0fdb
  • support the roll-forward recovery and file level fsync()
  • block allocation: LFS, IPU, SSR
  • truncate

3rd release (June-25-2021)

  • Features: fsck, mount option, mkfs option
  • Remarts
  • fsck (base: bbf6e62)
  • support the ext-identify feature
  • support discard

4th release (July-30-2021 ~)

  • Testability
  • Features: buffered IO, gc (if writable PagedVfs is available)
  • Remarks
  • background/foreground gc
  • caching node/meta blocks
  • read ahead
  • Page level locking
  • buffered IO
  • mmap
  • IPU can be disabled.
  • support fvm
  • xattr

How to build

$ fx set core.x64 --with-base //bundles:tools --with-base //bundles:tests --with-base third_party/f2fs $ fx emu -N --headless (see third_party/f2fs/test_files/README.md for test)