mbox series

[0/3] btrfs-progs: rework how we traverse rootdir

Message ID cover.1722418505.git.wqu@suse.com (mailing list archive)
Headers show
Series btrfs-progs: rework how we traverse rootdir | expand

Message

Qu Wenruo July 31, 2024, 9:38 a.m. UTC
Thanks to Mark's recent work, I finally get some time to rework rootdir
traversal.

All the problems are described inside the second patch.
While the last patch is a small enhancement to --rootdir to reject hard
links.

With this change, it's much easier to support subvolume creations at
mkfs time:

- Create a hashmap (or other similar structure) to record all the
  directories that should be subvolume

- Call btrfs_make_subvoume() other than btrfs_insert_inode() if a path
  should be a subvolume

- Call btrfs_link_subvolume() other than btrfs_add_link() for a
  subvolume

Everything like parent directory inode size is properly handled by
btrfs_link_subvolume() and btrfs_add_link() already.

Qu Wenruo (3):
  btrfs-progs: constify the name parameter of btrfs_add_link()
  btrfs-progs: mkfs: rework how we traverse rootdir
  btrfs-progs: rootdir: reject hard links

 kernel-shared/ctree.h |   2 +-
 kernel-shared/inode.c |   2 +-
 mkfs/rootdir.c        | 676 +++++++++++++++++-------------------------
 mkfs/rootdir.h        |   8 -
 4 files changed, 271 insertions(+), 417 deletions(-)

--
2.45.2