mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 11:18:52 +03:00
compress: change zio_compress API to use ABDs
This commit changes the frontend zio_compress_data and zio_decompress_data APIs to take ABD points instead of buffer pointers. All callers are updated to match. Any that already have an appropriate ABD nearby now use it directly, while at the rest we create an one. Internally, the ABDs are passed through to the provider directly. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
This commit is contained in:
+7
-5
@@ -142,11 +142,13 @@ 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);
|
||||
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);
|
||||
abd_t cabd, dabd;
|
||||
abd_get_from_buf_struct(&cabd, dstbuf, psize);
|
||||
abd_get_from_buf_struct(&dabd, buf, buflen);
|
||||
VERIFY0(zio_decompress_data(BP_GET_COMPRESS(bp), &cabd,
|
||||
&dabd, psize, buflen, NULL));
|
||||
abd_free(&dabd);
|
||||
abd_free(&cabd);
|
||||
} else {
|
||||
ASSERT3U(lsize, ==, psize);
|
||||
decode_embedded_bp_compressed(bp, buf);
|
||||
|
||||
Reference in New Issue
Block a user