Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/5] btrfs-progs: enhance --subvol/--inode-flags options
Date: Mon, 18 Aug 2025 10:01:42 +0930	[thread overview]
Message-ID: <cover.1755474438.git.wqu@suse.com> (raw)

Currently both --subvol and --inode-flags save the full path into their
structures, and check each inode against those full path.

For long paths it can be time consuming, and this introduces extra
memory for each structure.

This series enhance the handling of those options by:

- Extract the validation part into a dedicated helper inside
  rootdir.[ch]

- Use st_dev/st_ino to replace full_path
  This reduces runtime and memory usage for the involved structures.

- Remove the memory usage warning note
  Even with the old 8K per structure memory usage, 1024 options will
  only 8M memory, that's accetable even for a lot of micro-controllers,
  not to mention modern desktop/servers.

  I'm a little paranoid at that time, with the memory usage almost
  halved, we can safely remove that warning note.

Qu Wenruo (5):
  btrfs-progs: mkfs/rootdir: extract subvol validation code into a
    helper
  btrfs-progs: mkfs/rootdir: extract inode flags validation code into a
    helper
  btrfs-progs: mkfs/rootdir: enhance subvols detection
  btrfs-progs: mkfs/rootdir: enhance inode flags detection
  btrfs-progs: doc/mkfs: remove the note about memory usage

 Documentation/mkfs.btrfs.rst |   5 --
 mkfs/main.c                  |  84 ++------------------
 mkfs/rootdir.c               | 147 +++++++++++++++++++++++++++++++----
 mkfs/rootdir.h               |  14 +++-
 4 files changed, 148 insertions(+), 102 deletions(-)

--
2.50.1


             reply	other threads:[~2025-08-18  0:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-18  0:31 Qu Wenruo [this message]
2025-08-18  0:31 ` [PATCH 1/5] btrfs-progs: mkfs/rootdir: extract subvol validation code into a helper Qu Wenruo
2025-08-18  0:31 ` [PATCH 2/5] btrfs-progs: mkfs/rootdir: extract inode flags " Qu Wenruo
2025-08-18  0:31 ` [PATCH 3/5] btrfs-progs: mkfs/rootdir: enhance subvols detection Qu Wenruo
2025-08-18  0:31 ` [PATCH 4/5] btrfs-progs: mkfs/rootdir: enhance inode flags detection Qu Wenruo
2025-08-18  0:31 ` [PATCH 5/5] btrfs-progs: doc/mkfs: remove the note about memory usage Qu Wenruo
2025-08-18 15:01 ` [PATCH 0/5] btrfs-progs: enhance --subvol/--inode-flags options David Sterba

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=cover.1755474438.git.wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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