]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: get rid of compressed_folios[] usage for compressed read
authorQu Wenruo <wqu@suse.com>
Thu, 29 Jan 2026 03:23:44 +0000 (13:53 +1030)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Feb 2026 06:59:07 +0000 (07:59 +0100)
commitdafcfa1c8e377a3d8e2e1d72a76435b57ed1ac7d
treeb47f43b0618873f5550ee80297ea2816e55a1b0c
parent26902be0cd0997b34ef13593e35ef3501a3c70b5
btrfs: get rid of compressed_folios[] usage for compressed read

Currently btrfs_submit_compressed_read() still uses
compressed_bio::compressed_folios[] array.

Change it to allocate each folio and queue them into the compressed bio
so that we do not need to allocate that array.

Considering how small each compressed read bio is (less than 128KiB), we
do not benefit that much from btrfs_alloc_folio_array() anyway,
while we may benefit more from btrfs_alloc_compr_folio() by using
the global folio pool.

So changing from btrfs_alloc_folio_array() to btrfs_alloc_compr_folio()
in a loop should still be fine.

This removes one error path, and paves the way to completely remove
compressed_folios[] array.

Reviewed-by: Boris Burkov <boris@bur.io>
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.c