|
@@ -44,6 +44,21 @@
|
|
|
#include "extent_io.h"
|
|
|
#include "extent_map.h"
|
|
|
|
|
|
+static const char* const btrfs_compress_types[] = { "", "zlib", "lzo", "zstd" };
|
|
|
+
|
|
|
+const char* btrfs_compress_type2str(enum btrfs_compression_type type)
|
|
|
+{
|
|
|
+ switch (type) {
|
|
|
+ case BTRFS_COMPRESS_ZLIB:
|
|
|
+ case BTRFS_COMPRESS_LZO:
|
|
|
+ case BTRFS_COMPRESS_ZSTD:
|
|
|
+ case BTRFS_COMPRESS_NONE:
|
|
|
+ return btrfs_compress_types[type];
|
|
|
+ }
|
|
|
+
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
static int btrfs_decompress_bio(struct compressed_bio *cb);
|
|
|
|
|
|
static inline int compressed_bio_size(struct btrfs_fs_info *fs_info,
|