summaryrefslogtreecommitdiff
path: root/fs/bcachefs/opts.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-11-12 18:30:55 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:11 -0400
commitc258f28ebab6be176f20173aac725092b39cbd2c (patch)
treec027b4670d7750d35233dc7cc47e5d56cf012302 /fs/bcachefs/opts.c
parent319f9ac38eaba628d69b6ddbf402b35487315fc1 (diff)
bcachefs: Check for unsupported features
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/opts.c')
-rw-r--r--fs/bcachefs/opts.c15
1 files changed, 15 insertions, 0 deletions
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 <linux/kernel.h>
#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;