]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: make compression path to be subpage compatible
authorQu Wenruo <wqu@suse.com>
Wed, 29 May 2024 07:33:47 +0000 (17:03 +0930)
committerDavid Sterba <dsterba@suse.com>
Tue, 10 Sep 2024 14:51:20 +0000 (16:51 +0200)
commitfd1e75d0105d2289e24b6d63cee49e6f7952c8bf
tree7d4844b1731f52569a694ca5cc5cf795ca6f95a4
parent9ca0e58cb752b09816f56f7a3147a39773d5e831
btrfs: make compression path to be subpage compatible

Currently btrfs compression path is not really subpage compatible, every
thing is still done in page unit.

That's fine for regular sector size and subpage routine. As even for
subpage routine compression is only enabled if the whole range is page
aligned, so reading the page cache in page unit is totally fine.

However in preparation for the future subpage perfect compression
support, we need to change the compression routine to properly handle a
subpage range.

This patch would prepare both zlib and zstd to only read the subpage
range for compression.
Lzo is already doing subpage aware read, as lzo's on-disk format is
already sectorsize dependent.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.h
fs/btrfs/zlib.c
fs/btrfs/zstd.c