linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH 0/7] Add 16K Support for f2fs-tools
@ 2023-08-16  1:13 Daniel Rosenberg via Linux-f2fs-devel
  2023-08-16  1:13 ` [f2fs-dev] [PATCH 1/7] f2fs-tools: Define constants in terms of BLKSIZE Daniel Rosenberg via Linux-f2fs-devel
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Daniel Rosenberg via Linux-f2fs-devel @ 2023-08-16  1:13 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: Jaegeuk Kim, kernel-team, Daniel Rosenberg

This adds support for different block sizes to f2fs-tools.

The first patch redefines all block size based constants to be based on the
block size. After this patch, you should be able to compile a version of
f2fs-tools that works for a given blocksize by just setting F2FS_BLKSIZE_BITS
in f2fs_fs.h. Running fsck on an f2fs filesystem of a different block size will
fail early, and should leave the fs untouched.

I was unsure how to handle things under tools/, so I've left them as is.

The rest of the patches refactor the code to allow it to handle different block
sizes with the same binary. The final patch puts this under a block size
argument in make_f2fs.

The refactor splits apart structs that have components with sizes derived from
the blocksize in the middle. If the component is at the end, it's treated as a
variable length array. This means that sizeof on affected structs will not work
as expected, and should be replaced with F2FS_BLKSIZE where appropriate. The
affected static_asserts are replaced with runtime asserts.

It touches a lot of places, but I think it's probably with it to be able to use
a single binary, particularly if we're ever going to be able to mount different
blocksize f2fs filesystems using the same kernel.

I was unable to get xfstests running on my 16k arm setup, so I wasn't able to
test it as thoroughly as I'd like to have, but it behaved the same on a 4k
x86_64 system, and fsck/mounted successfully on an arm64 system.

Daniel Rosenberg (7):
  f2fs-tools: Define constants in terms of BLKSIZE
  f2fs-tools: Refactor Orphan Block struct
  f2fs-tools: Refactor f2fs_node struct and friends
  f2fs-tools: Refactor SIT/NAT block structs
  f2fs-tools: Refactor Summary block struct and friends
  f2fs-tools: Refactor f2fs_dentry_block struct
  f2fs-tools: Support different block sizes

 fsck/dir.c               |  46 +++----
 fsck/dump.c              |  28 ++--
 fsck/f2fs.h              |   6 +-
 fsck/fsck.c              |  72 +++++------
 fsck/fsck.h              |   5 +-
 fsck/main.c              |   1 +
 fsck/mount.c             |  93 ++++++++------
 fsck/node.c              |  12 +-
 fsck/node.h              |  20 +--
 fsck/resize.c            |   2 +-
 include/f2fs_fs.h        | 271 ++++++++++++++++++++++++++++-----------
 lib/libf2fs.c            |   4 +-
 man/sload.f2fs.8         |   2 +-
 mkfs/f2fs_format.c       |  90 ++++++-------
 mkfs/f2fs_format_main.c  |  14 +-
 mkfs/f2fs_format_utils.c |   2 +-
 16 files changed, 405 insertions(+), 263 deletions(-)


base-commit: 6ebf6f2967d0a5731af1767d5735f46e30fea0fc
-- 
2.41.0.694.ge786442a9b-goog



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-08-25 22:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-16  1:13 [f2fs-dev] [PATCH 0/7] Add 16K Support for f2fs-tools Daniel Rosenberg via Linux-f2fs-devel
2023-08-16  1:13 ` [f2fs-dev] [PATCH 1/7] f2fs-tools: Define constants in terms of BLKSIZE Daniel Rosenberg via Linux-f2fs-devel
2023-08-25 17:39   ` Jaegeuk Kim
2023-08-25 22:43     ` Daniel Rosenberg via Linux-f2fs-devel
2023-08-16  1:13 ` [f2fs-dev] [PATCH 2/7] f2fs-tools: Refactor Orphan Block struct Daniel Rosenberg via Linux-f2fs-devel
2023-08-16  1:13 ` [f2fs-dev] [PATCH 3/7] f2fs-tools: Refactor f2fs_node struct and friends Daniel Rosenberg via Linux-f2fs-devel
2023-08-16  1:13 ` [f2fs-dev] [PATCH 4/7] f2fs-tools: Refactor SIT/NAT block structs Daniel Rosenberg via Linux-f2fs-devel
2023-08-16  1:13 ` [f2fs-dev] [PATCH 5/7] f2fs-tools: Refactor Summary block struct and friends Daniel Rosenberg via Linux-f2fs-devel
2023-08-16  1:13 ` [f2fs-dev] [PATCH 6/7] f2fs-tools: Refactor f2fs_dentry_block struct Daniel Rosenberg via Linux-f2fs-devel
2023-08-16  1:13 ` [f2fs-dev] [PATCH 7/7] f2fs-tools: Support different block sizes Daniel Rosenberg via Linux-f2fs-devel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).