Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/4] btrfs: add per-inode compression levels in xattrs
@ 2026-08-08  2:34 koraynilay
  2026-08-08  2:34 ` [PATCH 1/4] btrfs: export btrfs_match_compress_type(), move it to compression.h koraynilay
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: koraynilay @ 2026-08-08  2:34 UTC (permalink / raw)
  To: clm, dsterba; +Cc: linux-btrfs, koraynilay

Add per-inode compression levels using
btrfs property set /path/to/file compression "algo:level", using the
same syntax as the compress mount option
If set on folders, all new children will inherit the setting, while
already existing children will be unaffected.

This patch series keeps a legacy small "bug": when setting
btrfs.compression, it keeps the mount option level, even if the algo is
different (!!), so with e.g. compress=zstd:15 and btrfs.compression=zlib
the data gets compressed at zlib:9 (because it still gets clamped at the
right range). This way the behaviour of chattr +c is also unchanged.

I also wanna thank Zygo for helping me by explaining stuff and for
noticing this "bug".

koraynilay (4):
  btrfs: export btrfs_match_compress_type(), move it to compression.h
  btrfs: also validate compression levels in
    btrfs_compress_is_valid_type()
  btrfs: add per-inode compression levels in xattrs
  btrfs: support inheritance for per-inode compression levels

 fs/btrfs/btrfs_inode.h |  1 +
 fs/btrfs/compression.c | 28 ++++++++++++++++++---
 fs/btrfs/compression.h |  3 ++-
 fs/btrfs/inode.c       | 14 +++++++++++
 fs/btrfs/props.c       | 57 +++++++++++++++++++++++++++++++++---------
 fs/btrfs/super.c       |  8 ------
 6 files changed, 87 insertions(+), 24 deletions(-)


base-commit: a59f57e2aa127c5354168d2ec4bac920df1be4f4
-- 
2.55.0


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

end of thread, other threads:[~2026-08-10 22:42 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-08  2:34 [PATCH 0/4] btrfs: add per-inode compression levels in xattrs koraynilay
2026-08-08  2:34 ` [PATCH 1/4] btrfs: export btrfs_match_compress_type(), move it to compression.h koraynilay
2026-08-08  2:34 ` [PATCH 2/4] btrfs: also validate compression levels in btrfs_compress_is_valid_type() koraynilay
2026-08-08  2:34 ` [PATCH 3/4] btrfs: add per-inode compression levels in xattrs koraynilay
2026-08-08  2:34 ` [PATCH 4/4] btrfs: support inheritance for per-inode compression levels koraynilay
2026-08-09  0:17 ` [PATCH 0/4] btrfs: add per-inode compression levels in xattrs Qu Wenruo
2026-08-09  0:35   ` koraynilay
2026-08-09  1:00     ` Qu Wenruo
2026-08-09  1:32       ` koraynilay
2026-08-09 23:17       ` Zygo Blaxell
2026-08-09 23:20         ` Qu Wenruo
2026-08-10  0:28           ` Zygo Blaxell
2026-08-10  0:51             ` Qu Wenruo
2026-08-10  0:57               ` Zygo Blaxell
2026-08-10  1:05               ` koraynilay
2026-08-10  1:54                 ` Qu Wenruo
2026-08-10  1:57                   ` koraynilay
2026-08-10  1:57                     ` Qu Wenruo
2026-08-10  2:06                       ` Zygo Blaxell
2026-08-10  2:11                         ` Qu Wenruo
2026-08-10 22:41                 ` koraynilay

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