Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/5] btrfs-progs: enhance --subvol/--inode-flags options
@ 2025-08-18  0:31 Qu Wenruo
  2025-08-18  0:31 ` [PATCH 1/5] btrfs-progs: mkfs/rootdir: extract subvol validation code into a helper Qu Wenruo
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Qu Wenruo @ 2025-08-18  0:31 UTC (permalink / raw)
  To: linux-btrfs

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


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

end of thread, other threads:[~2025-08-18 15:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18  0:31 [PATCH 0/5] btrfs-progs: enhance --subvol/--inode-flags options Qu Wenruo
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox