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 <dsterba@suse.com>
This commit is contained in:
David Sterba 2026-01-06 17:20:30 +01:00
parent 5b93f24168
commit 4d083672b4

View File

@ -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. */