summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/zstd.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-09-15 17:36:57 +0200
committerDavid Sterba <dsterba@suse.com>2017-11-01 20:45:29 +0100
commitf51d2b59120ff364a5e612a594ed358767e1cd09 (patch)
tree349ed68bde053fc040138f4255aca2dab83b0bba /fs/btrfs/zstd.c
parentd4417e22551377c6e589c15ff2b931610e5230bc (diff)
downloadlinux-f51d2b59120ff364a5e612a594ed358767e1cd09.tar.bz2
btrfs: allow to set compression level for zlib
Preliminary support for setting compression level for zlib, the following works: $ mount -o compess=zlib # default $ mount -o compess=zlib0 # same $ mount -o compess=zlib9 # level 9, slower sync, less data $ mount -o compess=zlib1 # level 1, faster sync, more data $ mount -o remount,compress=zlib3 # level set by remount The compress-force works the same as compress'. The level is visible in the same format in /proc/mounts. Level set via file property does not work yet. Required patch: "btrfs: prepare for extensions in compression options" Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/zstd.c')
-rw-r--r--fs/btrfs/zstd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/zstd.c b/fs/btrfs/zstd.c
index 607ce47b483a..17f2dd8fddb8 100644
--- a/fs/btrfs/zstd.c
+++ b/fs/btrfs/zstd.c
@@ -423,10 +423,15 @@ finish:
return ret;
}
+static void zstd_set_level(struct list_head *ws, unsigned int type)
+{
+}
+
const struct btrfs_compress_op btrfs_zstd_compress = {
.alloc_workspace = zstd_alloc_workspace,
.free_workspace = zstd_free_workspace,
.compress_pages = zstd_compress_pages,
.decompress_bio = zstd_decompress_bio,
.decompress = zstd_decompress,
+ .set_level = zstd_set_level,
};