Skip to content

btrfs-progs: new --inode-flags option

Qu Wenruo linux-btrfs 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 1 replyIn review
  2. v14 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Fix typos
Exposed by github CI:

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4btrfs-progs: allow new inodes to inherit flags from their parentskernel-shared/inode.c+64 -00 replies
2/4btrfs-progs: do not generate checksum nor compress if the inode has NODATACOW or NODATASUMmkfs/rootdir.c+13 -40 replies
3/4btrfs-progs: mkfs: add --inode-flags optionDocumentation/mkfs.btrfs.rst mkfs/main.c mkfs/rootdir.c +1 more+243 -50 replies
4/4btrfs-progs: mkfs-tests: a new test case for --inode-flagstests/mkfs-tests/038-inode-flags/test.sh+55 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] btrfs-progs: new --inode-flags option

[CHANGELOG]
v2:
- Fix typos
Exposed by github CI:

./mkfs/rootdir.c:1618: inheritted ==> inherited ./kernel-shared/inode.c:161: Similiar ==> Similar ./Documentation/mkfs.btrfs.rst:219: speicified ==> specified

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