p != export_targets.end(); ++p) {
f->dump_int("mds", *p);
}
+ f->dump_unsigned("features", mds_features);
f->close_section();
}
void MDSMap::mds_info_t::encode_versioned(bufferlist& bl, uint64_t features) const
{
- ENCODE_START(4, 4, bl);
+ ENCODE_START(5, 4, bl);
::encode(global_id, bl);
::encode(name, bl);
::encode(rank, bl);
::encode(standby_for_rank, bl);
::encode(standby_for_name, bl);
::encode(export_targets, bl);
+ ::encode(mds_features, bl);
ENCODE_FINISH(bl);
}
void MDSMap::mds_info_t::decode(bufferlist::iterator& bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(4, 4, 4, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(5, 4, 4, bl);
::decode(global_id, bl);
::decode(name, bl);
::decode(rank, bl);
::decode(standby_for_name, bl);
if (struct_v >= 2)
::decode(export_targets, bl);
+ if (struct_v >= 5)
+ ::decode(mds_features, bl);
DECODE_FINISH(bl);
}
mds_rank_t standby_for_rank;
std::string standby_for_name;
std::set<mds_rank_t> export_targets;
+ uint64_t mds_features;
mds_info_t() : global_id(MDS_GID_NONE), rank(MDS_RANK_NONE), inc(0), state(STATE_STANDBY), state_seq(0),
standby_for_rank(MDS_NO_STANDBY_PREF) { }
s = failed;
}
+ // features
+ uint64_t get_up_features() {
+ uint64_t f = 0;
+ for (std::map<mds_rank_t, mds_gid_t>::const_iterator p = up.begin();
+ p != up.end();
+ ++p) {
+ std::map<mds_gid_t, mds_info_t>::const_iterator q = mds_info.find(p->second);
+ assert(q != mds_info.end());
+ f |= q->second.mds_features;
+ }
+ return f;
+ }
+
/**
* Get MDS ranks which are in but not up.
*/