kdave / btrfs-progs

Development of userspace BTRFS tools
GNU General Public License v2.0
527 stars 239 forks source link

Cleanups #834

Open adam900710 opened 4 days ago

adam900710 commented 4 days ago

Thanks to Mark's new effort to introduce subvolume creation ability, the long existing duplicated subvolume creation problem is exposed again.

The first patch to do a small cleanup for btrfs_create_tree() so that the parameter list matches the kernel one.

The second one is the main dish to fully merge the different functions to create a subvolume.

We have btrfs_create_tree() to properly create an empty tree, and btrfs_make_root_dir() to create the initial root dir.

So use them to create btrfs_make_subvolume():