Skip to content

btrfs-progs: enhance --subvol/--inode-flags options

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5btrfs-progs: mkfs/rootdir: extract subvol validation code into a helpermkfs/main.c mkfs/rootdir.c mkfs/rootdir.h+51 -440 replies
2/5btrfs-progs: mkfs/rootdir: extract inode flags validation code into a helpermkfs/main.c mkfs/rootdir.c mkfs/rootdir.h+43 -340 replies
3/5btrfs-progs: mkfs/rootdir: enhance subvols detectionmkfs/rootdir.c mkfs/rootdir.h+40 -160 replies
4/5btrfs-progs: mkfs/rootdir: enhance inode flags detectionmkfs/rootdir.c mkfs/rootdir.h+23 -120 replies
5/5btrfs-progs: doc/mkfs: remove the note about memory usageDocumentation/mkfs.btrfs.rst+0 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] btrfs-progs: enhance --subvol/--inode-flags options

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