From c258f28ebab6be176f20173aac725092b39cbd2c Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 12 Nov 2018 18:30:55 -0500 Subject: bcachefs: Check for unsupported features Signed-off-by: Kent Overstreet --- fs/bcachefs/opts.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'fs/bcachefs/opts.c') diff --git a/fs/bcachefs/opts.c b/fs/bcachefs/opts.c index c12af1a86f0b..74e92a196ccd 100644 --- a/fs/bcachefs/opts.c +++ b/fs/bcachefs/opts.c @@ -3,6 +3,7 @@ #include #include "bcachefs.h" +#include "compress.h" #include "disk_groups.h" #include "opts.h" #include "super-io.h" @@ -269,6 +270,20 @@ void bch2_opt_to_text(struct printbuf *out, struct bch_fs *c, } } +int bch2_opt_check_may_set(struct bch_fs *c, int id, u64 v) +{ + int ret = 0; + + switch (id) { + case Opt_compression: + case Opt_background_compression: + ret = bch2_check_set_has_compressed_data(c, v); + break; + } + + return ret; +} + int bch2_parse_mount_opts(struct bch_opts *opts, char *options) { char *opt, *name, *val; -- cgit v1.2.3