summaryrefslogtreecommitdiff
path: root/fs/bcachefs/opts.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-11-29 21:47:42 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:32 +0300
commitba239c954e840875a912230439f28b4e4fbea8ff (patch)
treea46e408927d580bb1c75f1beb4a93b1d6fbca986 /fs/bcachefs/opts.c
parent9ba68f6cdc79b0eab707bf8b50f418da05b6ff5e (diff)
downloadlinux-ba239c954e840875a912230439f28b4e4fbea8ff.tar.xz
bcachefs: bch2_check_set_feature()
New helper function for setting incompatible feature bits 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.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/bcachefs/opts.c b/fs/bcachefs/opts.c
index 13a9a2fcd575..cbacd2f36799 100644
--- a/fs/bcachefs/opts.c
+++ b/fs/bcachefs/opts.c
@@ -299,15 +299,8 @@ int bch2_opt_check_may_set(struct bch_fs *c, int id, u64 v)
ret = bch2_check_set_has_compressed_data(c, v);
break;
case Opt_erasure_code:
- if (v &&
- !(c->sb.features & (1ULL << BCH_FEATURE_EC))) {
- mutex_lock(&c->sb_lock);
- c->disk_sb.sb->features[0] |=
- cpu_to_le64(1ULL << BCH_FEATURE_EC);
-
- bch2_write_super(c);
- mutex_unlock(&c->sb_lock);
- }
+ if (v)
+ bch2_check_set_feature(c, BCH_FEATURE_EC);
break;
}