]> git.ipfire.org Git - thirdparty/linux.git/commit
btrfs: zlib: introduce zlib_compress_bio() helper
authorQu Wenruo <wqu@suse.com>
Thu, 29 Jan 2026 03:23:40 +0000 (13:53 +1030)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Feb 2026 06:59:06 +0000 (07:59 +0100)
commit3d74a7556fbab89a3e78f514cf39d3413b9963d1
tree2f3c3b72089cdedb7619824ebd5fbd07b42f4398
parentbba959655ac5665f3ad2fc244c98da48d2ae4c17
btrfs: zlib: introduce zlib_compress_bio() helper

The new helper has the following enhancements against the existing
zlib_compress_folios()

- Much smaller parameter list

  No more shared IN/OUT members, no need to pre-allocate a
  compressed_folios[] array.

  Just a workspace and compressed_bio pointer, everything we need can be
  extracted from that @cb pointer.

- Ready-to-be-submitted compressed bio

  Although the caller still needs to do some common works like
  rounding up and zeroing the tailing part of the last fs block.

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.h
fs/btrfs/zlib.c