compress: rework callers to always use the zio_compress calls

This will make future refactoring easier.

There are two we can't change for the moment, because zio_compress_data
does hole detection & collapsing which zio_decompress_data does not
actually know how to handle.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
This commit is contained in:
Rob Norris
2024-07-04 16:11:12 +10:00
committed by Tony Hutter
parent ba2209ec9e
commit 5eede0d5fd
3 changed files with 15 additions and 6 deletions
+5 -2
View File
@@ -142,8 +142,11 @@ decode_embedded_bp(const blkptr_t *bp, void *buf, int buflen)
if (BP_GET_COMPRESS(bp) != ZIO_COMPRESS_OFF) {
uint8_t dstbuf[BPE_PAYLOAD_SIZE];
decode_embedded_bp_compressed(bp, dstbuf);
VERIFY0(zio_decompress_data_buf(BP_GET_COMPRESS(bp),
dstbuf, buf, psize, buflen, NULL));
abd_t dstabd;
abd_get_from_buf_struct(&dstabd, dstbuf, psize);
VERIFY0(zio_decompress_data(BP_GET_COMPRESS(bp), &dstabd,
buf, psize, buflen, NULL));
abd_free(&dstabd);
} else {
ASSERT3U(lsize, ==, psize);
decode_embedded_bp_compressed(bp, buf);