From fa4d885a482ef52ad3efa12a5799a3f6408b0718 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Fri, 15 Sep 2017 17:36:58 +0200 Subject: btrfs: allow setting zlib compression level via :9 This is bikeshedding, but it seems people are drastically more likely to understand "zlib:9" as compression level rather than an algorithm version compared to "zlib9". Based on feedback on the mailinglist, the ":9" will be the only accepted syntax. The level must be a single digit. Unrecognized format will result to the default, for forward compatibility in a similar way the compression algorithm specifier was relaxed in commit a7164fa4e055daf6368c ("btrfs: prepare for extensions in compression options"). Signed-off-by: Adam Borowski Reviewed-by: David Sterba [ tighten the accepted format ] Signed-off-by: David Sterba --- fs/btrfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/btrfs/super.c') diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 57f3f9600e18..65af029559b5 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1261,7 +1261,7 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry) else seq_printf(seq, ",compress=%s", compress_type); if (info->compress_level) - seq_printf(seq, "%d", info->compress_level); + seq_printf(seq, ":%d", info->compress_level); } if (btrfs_test_opt(info, NOSSD)) seq_puts(seq, ",nossd"); -- cgit v1.2.3-55-g7522