linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Daniel Rosenberg via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>,
	kernel-team@android.com, Daniel Rosenberg <drosen@google.com>
Subject: [f2fs-dev] [PATCH 0/7] Add 16K Support for f2fs-tools
Date: Tue, 15 Aug 2023 18:13:52 -0700	[thread overview]
Message-ID: <20230816011359.1964484-1-drosen@google.com> (raw)

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

             reply	other threads:[~2023-08-16  2:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16  1:13 Daniel Rosenberg via Linux-f2fs-devel [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230816011359.1964484-1-drosen@google.com \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=drosen@google.com \
    --cc=jaegeuk@kernel.org \
    --cc=kernel-team@android.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).