MCPcopy Create free account
hub / github.com/ceph/ceph / read_features_off_disk

Method read_features_off_disk

src/mon/Monitor.cc:644–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

642}
643
644void Monitor::read_features_off_disk(MonitorDBStore *store, CompatSet *features)
645{
646 bufferlist featuresbl;
647 store->get(MONITOR_NAME, COMPAT_SET_LOC, featuresbl);
648 if (featuresbl.length() == 0) {
649 generic_dout(0) << "WARNING: mon fs missing feature list.\n"
650 << "Assuming it is old-style and introducing one." << dendl;
651 //we only want the baseline ~v.18 features assumed to be on disk.
652 //If new features are introduced this code needs to disappear or
653 //be made smarter.
654 *features = get_legacy_features();
655
656 features->encode(featuresbl);
657 auto t(std::make_shared<MonitorDBStore::Transaction>());
658 t->put(MONITOR_NAME, COMPAT_SET_LOC, featuresbl);
659 store->apply_transaction(t);
660 } else {
661 auto it = featuresbl.cbegin();
662 features->decode(it);
663 }
664}
665
666void Monitor::read_features()
667{

Callers

nothing calls this directly

Calls 7

apply_transactionMethod · 0.80
getMethod · 0.45
lengthMethod · 0.45
encodeMethod · 0.45
putMethod · 0.45
cbeginMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected