diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-27 22:09:35 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:06 -0400 |
commit | ba8eeae8eee0aae03eb6be0372519b72057d312c (patch) | |
tree | cf0e95c6cdb1b8352d81fae07928df901e628334 /fs/bcachefs/super-io.h | |
parent | 30a8278a1e2f627b1f28ab521e40eecacb223efc (diff) | |
download | linux-stable-ba8eeae8eee0aae03eb6be0372519b72057d312c.tar.gz linux-stable-ba8eeae8eee0aae03eb6be0372519b72057d312c.tar.bz2 linux-stable-ba8eeae8eee0aae03eb6be0372519b72057d312c.zip |
bcachefs: bcachefs_metadata_version_major_minor
This introduces major/minor versioning to the superblock version number.
Major version number changes indicate incompatible releases; we can move
forward to a new major version number, but not backwards. Minor version
numbers indicate compatible changes - these add features, but can still
be mounted and used by old versions.
With the recent patches that make it possible to roll out new btrees and
key types without breaking compatibility, we should be able to roll out
most new features without incompatible changes.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super-io.h')
-rw-r--r-- | fs/bcachefs/super-io.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/super-io.h b/fs/bcachefs/super-io.h index cda71ec845a5..a850cc4ae6c7 100644 --- a/fs/bcachefs/super-io.h +++ b/fs/bcachefs/super-io.h @@ -11,11 +11,12 @@ static inline bool bch2_version_compatible(u16 version) { - return version <= bcachefs_metadata_version_current && + return BCH_VERSION_MAJOR(version) <= BCH_VERSION_MAJOR(bcachefs_metadata_version_current) && version >= bcachefs_metadata_version_min; } void bch2_version_to_text(struct printbuf *, unsigned); +unsigned bch2_latest_compatible_version(unsigned); struct bch_sb_field *bch2_sb_field_get(struct bch_sb *, enum bch_sb_field_type); struct bch_sb_field *bch2_sb_field_resize(struct bch_sb_handle *, |