summaryrefslogtreecommitdiff
path: root/fs/bcachefs/opts.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-02-21 03:47:58 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:55 +0300
commit2436cb9fada98d477bb3508a30e520ab3bfaae3e (patch)
tree8931dcf95d2ec9b8cecbd22527bf74e00461f355 /fs/bcachefs/opts.c
parent41f8b09edc25d8ea1f4cee44a9931deb3cf8b9d6 (diff)
downloadlinux-2436cb9fada98d477bb3508a30e520ab3bfaae3e.tar.xz
bcachefs: Use x-macros for more enums
This patch standardizes all the enums that have associated string tables (probably more enums should have string tables). 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.c45
1 files changed, 9 insertions, 36 deletions
diff --git a/fs/bcachefs/opts.c b/fs/bcachefs/opts.c
index a6c734efe328..0cfbb56a57c1 100644
--- a/fs/bcachefs/opts.c
+++ b/fs/bcachefs/opts.c
@@ -9,86 +9,59 @@
#include "super-io.h"
#include "util.h"
+#define x(t, n) #t,
+
const char * const bch2_error_actions[] = {
- "continue",
- "remount-ro",
- "panic",
+ BCH_ERROR_ACTIONS()
NULL
};
const char * const bch2_sb_features[] = {
-#define x(f, n) #f,
BCH_SB_FEATURES()
-#undef x
NULL
};
const char * const bch2_sb_compat[] = {
-#define x(f, n) #f,
BCH_SB_COMPAT()
-#undef x
NULL
};
const char * const bch2_btree_ids[] = {
-#define x(name, ...) #name,
BCH_BTREE_IDS()
-#undef x
NULL
};
const char * const bch2_csum_opts[] = {
- "none",
- "crc32c",
- "crc64",
+ BCH_CSUM_OPTS()
NULL
};
const char * const bch2_compression_opts[] = {
-#define x(t, n) #t,
BCH_COMPRESSION_OPTS()
-#undef x
NULL
};
const char * const bch2_str_hash_types[] = {
- "crc32c",
- "crc64",
- "siphash",
+ BCH_STR_HASH_OPTS()
NULL
};
const char * const bch2_data_types[] = {
-#define x(t, n) #t,
BCH_DATA_TYPES()
-#undef x
NULL
};
const char * const bch2_cache_replacement_policies[] = {
- "lru",
- "fifo",
- "random",
+ BCH_CACHE_REPLACEMENT_POLICIES()
NULL
};
-/* Default is -1; we skip past it for struct cached_dev's cache mode */
-const char * const bch2_cache_modes[] = {
- "default",
- "writethrough",
- "writeback",
- "writearound",
- "none",
+const char * const bch2_member_states[] = {
+ BCH_MEMBER_STATES()
NULL
};
-const char * const bch2_dev_state[] = {
- "readwrite",
- "readonly",
- "failed",
- "spare",
- NULL
-};
+#undef x
void bch2_opts_apply(struct bch_opts *dst, struct bch_opts src)
{