From: David Sterba Date: Tue, 6 Jan 2026 16:20:30 +0000 (+0100) Subject: btrfs: zlib: drop redundant folio address variable X-Git-Tag: v7.1-rc1~231^2~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d083672b49294c31a683fd0e50d468e555768ca;p=thirdparty%2Fkernel%2Flinux.git btrfs: zlib: drop redundant folio address variable We're caching the current output folio address but it's not really necessary as we store it in the variable and then pass it to the stream context. We can read the folio address directly. Signed-off-by: David Sterba --- diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c index 147c92a4dd04c..0640ab4da2b14 100644 --- a/fs/btrfs/zlib.c +++ b/fs/btrfs/zlib.c @@ -157,7 +157,6 @@ int zlib_compress_bio(struct list_head *ws, struct compressed_bio *cb) const u32 min_folio_size = btrfs_min_folio_size(fs_info); int ret; char *data_in = NULL; - char *cfolio_out; struct folio *in_folio = NULL; struct folio *out_folio = NULL; const u32 blocksize = fs_info->sectorsize; @@ -180,11 +179,10 @@ int zlib_compress_bio(struct list_head *ws, struct compressed_bio *cb) ret = -ENOMEM; goto out; } - cfolio_out = folio_address(out_folio); workspace->strm.next_in = workspace->buf; workspace->strm.avail_in = 0; - workspace->strm.next_out = cfolio_out; + workspace->strm.next_out = folio_address(out_folio); workspace->strm.avail_out = min_folio_size; while (workspace->strm.total_in < len) { @@ -263,9 +261,8 @@ int zlib_compress_bio(struct list_head *ws, struct compressed_bio *cb) ret = -ENOMEM; goto out; } - cfolio_out = folio_address(out_folio); workspace->strm.avail_out = min_folio_size; - workspace->strm.next_out = cfolio_out; + workspace->strm.next_out = folio_address(out_folio); } /* We're all done. */ if (workspace->strm.total_in >= len) @@ -301,9 +298,8 @@ int zlib_compress_bio(struct list_head *ws, struct compressed_bio *cb) ret = -ENOMEM; goto out; } - cfolio_out = folio_address(out_folio); workspace->strm.avail_out = min_folio_size; - workspace->strm.next_out = cfolio_out; + workspace->strm.next_out = folio_address(out_folio); } } /* Queue the remaining part of the folio. */