diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-07-15 19:54:51 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-09-09 09:41:47 -0400 |
commit | 9092a38a3dfd70326a47eb8d3ff57e995e770ed4 (patch) | |
tree | 4ff34dfc7b4532d7e160924413404654c649c366 /fs/bcachefs/opts.c | |
parent | 4aedeac5703e06f5e9c1eeee6f77136bcc15afdb (diff) |
bcachefs: Opt_durability can now be set via bch2_opt_set_sb()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/opts.c')
-rw-r--r-- | fs/bcachefs/opts.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/bcachefs/opts.c b/fs/bcachefs/opts.c index 2e6e58360789..0770aebef6d8 100644 --- a/fs/bcachefs/opts.c +++ b/fs/bcachefs/opts.c @@ -623,7 +623,7 @@ struct bch_dev_sb_opt_set { static const struct bch_dev_sb_opt_set bch2_dev_sb_opt_setters [] = { #define x(n, set) [Opt_##n] = { .set_sb = SET_##set }, - BCH_DEV_OPTS() + BCH_DEV_OPT_SETTERS() #undef x }; @@ -638,6 +638,9 @@ void __bch2_opt_set_sb(struct bch_sb *sb, int dev_idx, if (opt->flags & OPT_SB_FIELD_ILOG2) v = ilog2(v); + if (opt->flags & OPT_SB_FIELD_ONE_BIAS) + v++; + if (opt->flags & OPT_FS) { if (opt->set_sb != SET_BCH2_NO_SB_OPT) opt->set_sb(sb, v); @@ -654,6 +657,8 @@ void __bch2_opt_set_sb(struct bch_sb *sb, int dev_idx, const struct bch_dev_sb_opt_set *set = bch2_dev_sb_opt_setters + id; if (set->set_sb) set->set_sb(m, v); + else + pr_err("option %s cannot be set via opt_set_sb()", opt->attr.name); } } |