abd: lift ABD zero scan from zio_compress_data() to abd_cmp_zero()

It's now the caller's responsibility do special handling for holes if
that's something it wants.

This also makes zio_compress_data() and zio_decompress_data() properly
the inverse of each other.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Jason Lee <jasonlee@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16326
This commit is contained in:
Rob Norris
2024-08-10 07:30:26 +10:00
committed by GitHub
parent f87fe67b44
commit b0bf14cdb5
4 changed files with 47 additions and 30 deletions
+7
View File
@@ -137,6 +137,7 @@ void abd_copy_from_buf_off(abd_t *, const void *, size_t, size_t);
void abd_copy_to_buf_off(void *, abd_t *, size_t, size_t);
int abd_cmp(abd_t *, abd_t *);
int abd_cmp_buf_off(abd_t *, const void *, size_t, size_t);
int abd_cmp_zero_off(abd_t *, size_t, size_t);
void abd_zero_off(abd_t *, size_t, size_t);
void abd_verify(abd_t *);
@@ -183,6 +184,12 @@ abd_zero(abd_t *abd, size_t size)
abd_zero_off(abd, 0, size);
}
static inline int
abd_cmp_zero(abd_t *abd, size_t size)
{
return (abd_cmp_zero_off(abd, 0, size));
}
/*
* ABD type check functions
*/