summaryrefslogtreecommitdiff
path: root/fs/bcachefs/super-io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-06-27 23:34:02 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:10:06 -0400
commit3045bb958acf5d3bc799c791d14e40676477bd16 (patch)
tree96b0cb3ac2b3c92ef2179b0e74e32906aef252d7 /fs/bcachefs/super-io.c
parent24964e1c5c89e00ca55909ab24ce8d28e2b46406 (diff)
bcachefs: version_upgrade is now an enum
The version_upgrade parameter is now an enum, not a bool, and it's persistent in the superblock: - compatible (default): upgrade to the latest compatible version - incompatible: upgrade to latest incompatible version - none Currently all upgrades are incompatible upgrades, but the next release will introduce major:minor versions. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super-io.c')
-rw-r--r--fs/bcachefs/super-io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c
index 71a1e2d76a15..1437c363a4ab 100644
--- a/fs/bcachefs/super-io.c
+++ b/fs/bcachefs/super-io.c
@@ -816,7 +816,7 @@ int bch2_write_super(struct bch_fs *c)
closure_init_stack(cl);
memset(&sb_written, 0, sizeof(sb_written));
- if (c->opts.version_upgrade) {
+ if (test_bit(BCH_FS_VERSION_UPGRADE, &c->flags)) {
c->disk_sb.sb->magic = BCHFS_MAGIC;
c->disk_sb.sb->layout.magic = BCHFS_MAGIC;
}
@@ -1197,11 +1197,11 @@ int bch2_fs_mark_dirty(struct bch_fs *c)
if (BCH_SB_VERSION_UPGRADE_COMPLETE(c->disk_sb.sb) > bcachefs_metadata_version_current)
SET_BCH_SB_VERSION_UPGRADE_COMPLETE(c->disk_sb.sb, bcachefs_metadata_version_current);
- if (c->opts.version_upgrade ||
+ if (test_bit(BCH_FS_VERSION_UPGRADE, &c->flags) ||
c->sb.version > bcachefs_metadata_version_current)
c->disk_sb.sb->version = cpu_to_le16(bcachefs_metadata_version_current);
- if (c->opts.version_upgrade)
+ if (test_bit(BCH_FS_VERSION_UPGRADE, &c->flags))
c->disk_sb.sb->features[0] |= cpu_to_le64(BCH_SB_FEATURES_ALL);
c->disk_sb.sb->features[0] |= cpu_to_le64(BCH_SB_FEATURES_ALWAYS);