linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] btrfs-progs: mkfs: introduce an experimental --subvol option
@ 2023-10-16  4:38 Qu Wenruo
  2023-10-16  4:38 ` [PATCH 1/6] btrfs-progs: enhance btrfs_mkdir() function Qu Wenruo
                   ` (6 more replies)
  0 siblings, 7 replies; 19+ messages in thread
From: Qu Wenruo @ 2023-10-16  4:38 UTC (permalink / raw)
  To: linux-btrfs

Issue #42 (good number by the way) is suggesting a very useful feature
for rootfs image creation.

Currently we only support "mkfs.btrfs --rootdir" to fill the fs tree
with target directory, but there has no btrfs specific features
involved.

If we can create certain paths as subvolumes, not pure directories, it
can be very useful to create the whole btrfs image just by "mkfs.btrfs"

This series is the first step torwards this idea.

Now we have a new experimental option "--subvol" for mkfs.btrfs, but
with the following limits:

- No co-operation with --rootdir
  This requires --rootdir to have extra handling for any existing
  inodes.
  (Currently --rootdir assumes the fs tree is completely empty)

- No multiple --subvol options supports
  This requires us to collect and sort all the paths and start creating
  subvolumes from the shortest path.
  Furthermore this requires us to create subvolume under another
  subvolume.

Each limit would need a new series of patches to address, but this
series would already provide a working but not-that-useful
implementation of "--subvol" option, along with a basic test case for
it.

Qu Wenruo (6):
  btrfs-progs: enhance btrfs_mkdir() function
  btrfs-progs: enhance and rename btrfs_mksubvol() function
  btrfs-progs: enhance btrfs_create_root() function
  btrfs-progs: use a unified btrfs_make_subvol() implementation
  btrfs-progs: mkfs: introduce experimental --subvol option
  btrfs-progs: mkfs-tests: introduce a test case to verify --subvol
    option

 convert/main.c                             |  60 ++------
 kernel-shared/ctree.c                      | 106 ++++++--------
 kernel-shared/ctree.h                      |  12 +-
 kernel-shared/inode.c                      | 129 ++++++++++++-----
 kernel-shared/root-tree.c                  |  86 +++++++++++
 mkfs/common.c                              |  39 -----
 mkfs/common.h                              |   2 -
 mkfs/main.c                                | 103 ++++----------
 mkfs/rootdir.c                             | 157 +++++++++++++++++++++
 mkfs/rootdir.h                             |   1 +
 tests/mkfs-tests/031-subvol-option/test.sh |  39 +++++
 tune/convert-bgt.c                         |   3 +-
 tune/quota.c                               |   2 +-
 13 files changed, 473 insertions(+), 266 deletions(-)
 create mode 100755 tests/mkfs-tests/031-subvol-option/test.sh

--
2.42.0


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

end of thread, other threads:[~2023-10-25 22:57 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-16  4:38 [PATCH 0/6] btrfs-progs: mkfs: introduce an experimental --subvol option Qu Wenruo
2023-10-16  4:38 ` [PATCH 1/6] btrfs-progs: enhance btrfs_mkdir() function Qu Wenruo
2023-10-16  4:38 ` [PATCH 2/6] btrfs-progs: enhance and rename btrfs_mksubvol() function Qu Wenruo
2023-10-16  4:38 ` [PATCH 3/6] btrfs-progs: enhance btrfs_create_root() function Qu Wenruo
2023-10-16  4:38 ` [PATCH 4/6] btrfs-progs: use a unified btrfs_make_subvol() implementation Qu Wenruo
2023-10-17 13:49   ` Josef Bacik
2023-10-17 20:14     ` Qu Wenruo
2023-10-17 23:11       ` David Sterba
2023-10-17 23:50         ` Qu Wenruo
2023-10-24 17:38           ` David Sterba
2023-10-24 20:44             ` Qu Wenruo
2023-10-25 16:18               ` David Sterba
2023-10-25 22:41                 ` Qu Wenruo
2023-10-25 22:57                 ` Neal Gompa
2023-10-16  4:38 ` [PATCH 5/6] btrfs-progs: mkfs: introduce experimental --subvol option Qu Wenruo
2023-10-17 13:54   ` Josef Bacik
2023-10-17 20:13     ` Qu Wenruo
2023-10-16  4:38 ` [PATCH 6/6] btrfs-progs: mkfs-tests: introduce a test case to verify " Qu Wenruo
2023-10-19 18:19 ` [PATCH 0/6] btrfs-progs: mkfs: introduce an experimental " Goffredo Baroncelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).