public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/4] btrfs-progs: new --inode-flags option
Date: Wed, 21 May 2025 19:21:06 +0930	[thread overview]
Message-ID: <cover.1747820747.git.wqu@suse.com> (raw)

The new --inode-flags option allows us to specify certain btrfs specific
flags to each inode.

Currently we only support *nodatacow* and *nodatasum*.

But in the future compression flag can also be added, allowing more
accurate per-file compression.

Furthermore child inodes will inherit the flag from their parents,
meaning one only needs to specify the flag to the parent directory, then
all children files/directories will have the flag.

This new option also works well with --subvol, although one has to
note that, the inode flag inheritance does not cross subvolume boundary
(the same as the kernel).

Finally, nodatacow and nodatasum will disable compression, just like the
kernel.

Qu Wenruo (4):
  btrfs-progs: allow new inodes to inherit flags from their parents
  btrfs-progs: do not generate checksum nor compress if the inode has
    NODATACOW or NODATASUM
  btrfs-progs: mkfs: add --inode-flags option
  btrfs-progs: mkfs-tests: a new test case for --inode-flags

 Documentation/mkfs.btrfs.rst             |  35 +++++++
 kernel-shared/inode.c                    |  64 ++++++++++++
 mkfs/main.c                              | 120 ++++++++++++++++++++++-
 mkfs/rootdir.c                           |  95 ++++++++++++++++--
 mkfs/rootdir.h                           |  15 +++
 tests/mkfs-tests/038-inode-flags/test.sh |  55 +++++++++++
 6 files changed, 375 insertions(+), 9 deletions(-)
 create mode 100755 tests/mkfs-tests/038-inode-flags/test.sh

--
2.49.0


             reply	other threads:[~2025-05-21  9:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-21  9:51 Qu Wenruo [this message]
2025-05-21  9:51 ` [PATCH 1/4] btrfs-progs: allow new inodes to inherit flags from their parents Qu Wenruo
2025-05-21  9:51 ` [PATCH 2/4] btrfs-progs: do not generate checksum nor compress if the inode has NODATACOW or NODATASUM Qu Wenruo
2025-05-21  9:51 ` [PATCH 3/4] btrfs-progs: mkfs: add --inode-flags option Qu Wenruo
2025-05-21  9:51 ` [PATCH 4/4] btrfs-progs: mkfs-tests: a new test case for --inode-flags Qu Wenruo

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.1747820747.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