summaryrefslogtreecommitdiff
path: root/fs/bcachefs/opts.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-12-29 04:17:06 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:33 +0300
commit1c3ff72c0fa94651a226d3351d9df89d5eafd2d7 (patch)
treeb1aad6c4a0debf71af1479be7fc2a0a574b42db1 /fs/bcachefs/opts.c
parent27b3e52388e1e6b2babb71ec17efa029139e1511 (diff)
downloadlinux-1c3ff72c0fa94651a226d3351d9df89d5eafd2d7.tar.xz
bcachefs: Convert some enums to x-macros
Helps for preventing things from getting out of sync. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/opts.c')
-rw-r--r--fs/bcachefs/opts.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/fs/bcachefs/opts.c b/fs/bcachefs/opts.c
index cbacd2f36799..94d6c044a27d 100644
--- a/fs/bcachefs/opts.c
+++ b/fs/bcachefs/opts.c
@@ -16,18 +16,24 @@ const char * const bch2_error_actions[] = {
NULL
};
-const char * const bch2_csum_types[] = {
+const char * const bch2_sb_features[] = {
+#define x(f, n) #f,
+ BCH_SB_FEATURES()
+#undef x
+ NULL
+};
+
+const char * const bch2_csum_opts[] = {
"none",
"crc32c",
"crc64",
NULL
};
-const char * const bch2_compression_types[] = {
- "none",
- "lz4",
- "gzip",
- "zstd",
+const char * const bch2_compression_opts[] = {
+#define x(t, n) #t,
+ BCH_COMPRESSION_OPTS()
+#undef x
NULL
};
@@ -300,7 +306,7 @@ int bch2_opt_check_may_set(struct bch_fs *c, int id, u64 v)
break;
case Opt_erasure_code:
if (v)
- bch2_check_set_feature(c, BCH_FEATURE_EC);
+ bch2_check_set_feature(c, BCH_FEATURE_ec);
break;
}