Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: koraynilay <koray.fra@gmail.com>
To: Chris Mason <clm@fb.com>, David Sterba <dsterba@suse.com>
Cc: Qu Wenruo <wqu@suse.com>,
	Zygo Blaxell <ce3g8jdj@umail.furryterror.org>,
	linux-btrfs@vger.kernel.org, koraynilay <koray.fra@gmail.com>
Subject: [PATCH v2 0/4] btrfs: add per-inode compression levels in xattrs
Date: Sun,  9 Aug 2026 03:50:50 +0200	[thread overview]
Message-ID: <20260809015054.779137-1-koray.fra@gmail.com> (raw)

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

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       |  2 ++
 fs/btrfs/props.c       | 57 +++++++++++++++++++++++++++++++++---------
 fs/btrfs/super.c       |  8 ------
 6 files changed, 75 insertions(+), 24 deletions(-)


base-commit: a59f57e2aa127c5354168d2ec4bac920df1be4f4
-- 
2.55.0


             reply	other threads:[~2026-08-09  1:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-09  1:50 koraynilay [this message]
2026-08-09  1:50 ` [PATCH v2 1/4] btrfs: export btrfs_match_compress_type(), move it to compression.h koraynilay
2026-08-09  1:50 ` [PATCH v2 2/4] btrfs: also validate compression levels in btrfs_compress_is_valid_type() koraynilay
2026-08-09  2:53   ` Qu Wenruo
2026-08-09  3:35     ` koraynilay
2026-08-09  4:07       ` Qu Wenruo
2026-08-09  1:50 ` [PATCH v2 3/4] btrfs: add per-inode compression levels in xattrs koraynilay
2026-08-09  2:55   ` Qu Wenruo
2026-08-09  3:50     ` koraynilay
2026-08-09  4:05       ` Qu Wenruo
2026-08-11  2:55     ` koraynilay
2026-08-11  3:21       ` Qu Wenruo
2026-08-11  3:40         ` koraynilay
2026-08-11 12:47         ` koraynilay
2026-08-09  1:50 ` [PATCH v2 4/4] btrfs: support inheritance for per-inode compression levels koraynilay
2026-08-09  3:03   ` 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=20260809015054.779137-1-koray.fra@gmail.com \
    --to=koray.fra@gmail.com \
    --cc=ce3g8jdj@umail.furryterror.org \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /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