[PATCH v3 0/5] btrfs: add per-inode compression levels in xattrs

koraynilay <[email protected]>
Newsgroups org.kernel.vger.linux-btrfs
Message-ID <[email protected]>
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 also fixes a small bug: before, when setting
btrfs.compression, it would keep the mount option level, even if the
algo was different (!!), so with e.g. compress=zstd:15 and
btrfs.compression=zlib the data gets compressed at zlib:9 (because it
would still get clamped at the right range); now if the level isn't
explicitly set it will use the default level for the algo.

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

Changes in this v3:
* the first patch contains only the bugfix for the mentioned bug, so it
  can be backported to older kernels if needed;
* fix a bisection and compilation error.

koraynilay (5):
  btrfs: fix -o compress= level getting inherited by compression xattr
    property
  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 | 35 ++++++++++++++++++++--
 fs/btrfs/compression.h |  3 +-
 fs/btrfs/inode.c       |  2 ++
 fs/btrfs/props.c       | 66 ++++++++++++++++++++++++++++++++++--------
 fs/btrfs/super.c       |  8 -----
 6 files changed, 91 insertions(+), 24 deletions(-)


base-commit: a13307e97d5c54b65720bb71fa379960ded1e51a
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.