public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] btrfs-progs: new --inode-flags option
@ 2025-05-21  9:51 Qu Wenruo
  2025-05-21  9:51 ` [PATCH 1/4] btrfs-progs: allow new inodes to inherit flags from their parents Qu Wenruo
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Qu Wenruo @ 2025-05-21  9:51 UTC (permalink / raw)
  To: linux-btrfs

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


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

end of thread, other threads:[~2025-05-21  9:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-21  9:51 [PATCH 0/4] btrfs-progs: new --inode-flags option Qu Wenruo
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox