diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-02-21 01:47:58 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:08:55 +0200 |
commit | 2436cb9fada98d477bb3508a30e520ab3bfaae3e (patch) | |
tree | 8931dcf95d2ec9b8cecbd22527bf74e00461f355 /fs/bcachefs/opts.c | |
parent | bcachefs: Rename BTREE_ID enums for consistency with other enums (diff) | |
download | linux-2436cb9fada98d477bb3508a30e520ab3bfaae3e.tar.xz linux-2436cb9fada98d477bb3508a30e520ab3bfaae3e.zip |
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.c | 45 |
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) { |