if (ev >= 4)
::decode(legacy_mds_map.last_failure_osd_epoch, p);
if (ev >= 6) {
- ::decode(legacy_mds_map.ever_allowed_snaps, p);
- ::decode(legacy_mds_map.explicitly_allowed_snaps, p);
+ if (ev < 10) {
+ // previously this was a bool about snaps, not a flag map
+ bool flag;
+ ::decode(flag, p);
+ legacy_mds_map.ever_allowed_features = flag ? CEPH_MDSMAP_ALLOW_SNAPS : 0;
+ ::decode(flag, p);
+ legacy_mds_map.explicitly_allowed_features = flag ? CEPH_MDSMAP_ALLOW_SNAPS : 0;
+ } else {
+ ::decode(legacy_mds_map.ever_allowed_features, p);
+ ::decode(legacy_mds_map.explicitly_allowed_features, p);
+ }
} else {
- legacy_mds_map.ever_allowed_snaps = true;
- legacy_mds_map.explicitly_allowed_snaps = false;
+ legacy_mds_map.ever_allowed_features = CEPH_MDSMAP_ALLOW_SNAPS;
+ legacy_mds_map.explicitly_allowed_features = 0;
}
if (ev >= 7)
::decode(legacy_mds_map.inline_data_enabled, p);
{
f->dump_int("epoch", epoch);
f->dump_unsigned("flags", flags);
+ f->dump_unsigned("ever_allowed_features", ever_allowed_features);
+ f->dump_unsigned("explicitly_allowed_features", explicitly_allowed_features);
f->dump_stream("created") << created;
f->dump_stream("modified") << modified;
f->dump_int("tableserver", tableserver);
::encode(cas_pool, bl);
// kclient ignores everything from here
- __u16 ev = 9;
+ __u16 ev = 10;
::encode(ev, bl);
::encode(compat, bl);
::encode(metadata_pool, bl);
::encode(failed, bl);
::encode(stopped, bl);
::encode(last_failure_osd_epoch, bl);
- ::encode(ever_allowed_snaps, bl);
- ::encode(explicitly_allowed_snaps, bl);
+ ::encode(ever_allowed_features, bl);
+ ::encode(explicitly_allowed_features, bl);
::encode(inline_data_enabled, bl);
::encode(enabled, bl);
::encode(fs_name, bl);
if (ev >= 4)
::decode(last_failure_osd_epoch, p);
if (ev >= 6) {
- ::decode(ever_allowed_snaps, p);
- ::decode(explicitly_allowed_snaps, p);
+ if (ev < 10) {
+ // previously this was a bool about snaps, not a flag map
+ bool flag;
+ ::decode(flag, p);
+ legacy_mds_map.ever_allowed_features = flag ? CEPH_MDSMAP_ALLOW_SNAPS : 0;
+ ::decode(flag, p);
+ legacy_mds_map.explicitly_allowed_features = flag ? CEPH_MDSMAP_ALLOW_SNAPS : 0;
+ } else {
+ ::decode(ever_allowed_features, p);
+ ::decode(explicitly_allowed_features, p);
+ }
} else {
- ever_allowed_snaps = true;
- explicitly_allowed_snaps = false;
+ ever_allowed_features = CEPH_MDSMAP_ALLOW_SNAPS;
+ explicitly_allowed_features = 0;
}
if (ev >= 7)
::decode(inline_data_enabled, p);
std::map<mds_rank_t, mds_gid_t> up; // who is in those roles
std::map<mds_gid_t, mds_info_t> mds_info;
- bool ever_allowed_snaps; //< the cluster has ever allowed snap creation
- bool explicitly_allowed_snaps; //< the user has explicitly enabled snap creation
+ uint8_t ever_allowed_features; //< bitmap of features the cluster has allowed
+ uint8_t explicitly_allowed_features; //< bitmap of features explicitly enabled
bool inline_data_enabled;
cas_pool(-1),
metadata_pool(0),
max_mds(0),
- ever_allowed_snaps(false),
- explicitly_allowed_snaps(false),
+ ever_allowed_features(0),
+ explicitly_allowed_features(0),
inline_data_enabled(false),
cached_up_features(0)
{ }
void set_snaps_allowed() {
set_flag(CEPH_MDSMAP_ALLOW_SNAPS);
- ever_allowed_snaps = true;
- explicitly_allowed_snaps = true;
+ ever_allowed_features |= CEPH_MDSMAP_ALLOW_SNAPS;
+ explicitly_allowed_features |= CEPH_MDSMAP_ALLOW_SNAPS;
}
bool allows_snaps() { return test_flag(CEPH_MDSMAP_ALLOW_SNAPS); }
void clear_snaps_allowed() { clear_flag(CEPH_MDSMAP_ALLOW_SNAPS); }