compress: replace compress_blob() with compress_blob_explicit()

And make compress_xyz() return 0 on success, as we know which compression
algorithm is used when calling compress_blob().

Follow-up for 2360352ef0.
This commit is contained in:
Yu Watanabe
2023-04-11 09:14:34 +02:00
committed by Daan De Meyer
parent 7cb9ed5d38
commit bfeaa62dbc
6 changed files with 39 additions and 53 deletions
+1 -7
View File
@@ -63,7 +63,7 @@ int decompress_stream_xz(int fdf, int fdt, uint64_t max_size);
int decompress_stream_lz4(int fdf, int fdt, uint64_t max_size);
int decompress_stream_zstd(int fdf, int fdt, uint64_t max_size);
static inline int compress_blob_explicit(
static inline int compress_blob(
Compression compression,
const void *src, uint64_t src_size,
void *dst, size_t dst_alloc_size, size_t *dst_size) {
@@ -80,12 +80,6 @@ static inline int compress_blob_explicit(
}
}
#define compress_blob(src, src_size, dst, dst_alloc_size, dst_size) \
compress_blob_explicit( \
DEFAULT_COMPRESSION, \
src, src_size, \
dst, dst_alloc_size, dst_size)
static inline int compress_stream(int fdf, int fdt, uint64_t max_bytes, uint64_t *ret_uncompressed_size) {
switch (DEFAULT_COMPRESSION) {
case COMPRESSION_ZSTD: