[f2fs] code refactoring: mkfs.h, mkfs.cc

  Add default destructor (mkfs.h)
  Change ASCIIToUNICODE function name and Change output prameter position to last (mkfs.h, mkfs.cc)
  (comments on mkfs.h: #23, #35, #51 https://fuchsia-review.googlesource.com/c/third_party/f2fs/+/511845)

  Change multi line printf to one line (mkfs.cc)
  Change while roop to range-based for loop (mkfs.cc)
  (comments on mkfs.cc: #31, #173, #467 https://fuchsia-review.googlesource.com/c/third_party/f2fs/+/511846/6)

  Init struct member pointer to nullptr (mkfs.h)
  (comment: #53 https://fuchsia-review.googlesource.com/c/third_party/f2fs/+/511839)

  Change unsigned int style to uint32_t (mkfs.h, mkfs.cc)
  (comment: #142 https://fuchsia-review.googlesource.com/c/third_party/f2fs/+/511840)

  Change struct xxx to xxx (mkfs.h, mkfs.cc)
  (comment: #312 https://fuchsia-review.googlesource.com/c/third_party/f2fs/+/520881/2)

  Change int8_t err to zx_status_t (mkfs.h, mkfs.cc)
  (comment: #24, #106 https://fuchsia-review.googlesource.com/c/third_party/f2fs/+/520882)

  Change hard coded value to constexpr (mkfs.h, mkfs.cc)
  (comment: #9, #128 https://fuchsia-review.googlesource.com/c/third_party/f2fs/+/511840)

  Remove f2fs prefix (mkfs.h)
  (comment: #84 https://fuchsia-review.googlesource.com/c/third_party/f2fs/+/511841)

Change-Id: I1d3b82437f57c87105af2bc8d620eb6424f07d0e
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/f2fs/+/530799
Reviewed-by: Brett Wilson <brettw@google.com>
2 files changed
tree: a8027f1b9012b6c8c07dd2f797e105d37e7f1797
  1. test_files/
  2. third_party/
  3. tools/
  4. AUTHORS
  5. bcache.cc
  6. bcache.h
  7. BUILD.gn
  8. checkpoint.cc
  9. CONTRIBUTING.md
  10. data.cc
  11. dir.cc
  12. dir.h
  13. dir_hash.cc
  14. f2fs.cc
  15. f2fs.h
  16. f2fs_internal.h
  17. f2fs_layout.h
  18. f2fs_lib.h
  19. f2fs_types.h
  20. file.cc
  21. file.h
  22. LICENSE
  23. mkfs.cc
  24. mkfs.h
  25. namei.cc
  26. node.cc
  27. node.h
  28. PATENTS
  29. README.md
  30. recovery.cc
  31. segment.cc
  32. segment.h
  33. super.cc
  34. vnode.cc
  35. 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
  • 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 bringup.x64 --with //bundles:tools --with-base //bundles/buildbot:bringup --with-base third_party/f2fs --with-base third_party/f2fs/tools:f2fs-tools $ fx build $ fx emu -N --headless -hda third_party/f2fs/test_files/blk{500m or 1g}.bin (see third_party/f2fs/test_files/README.md for test)