linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/6] btrfs-progs: mkfs: introduce an experimental --subvol option
Date: Mon, 16 Oct 2023 15:08:46 +1030	[thread overview]
Message-ID: <cover.1697430866.git.wqu@suse.com> (raw)

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


             reply	other threads:[~2023-10-16  4:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16  4:38 Qu Wenruo [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1697430866.git.wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).