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

Method decode

src/common/CompatSet.cc:31–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31void CompatSet::FeatureSet::decode(ceph::buffer::list::const_iterator& bl) {
32 using ceph::decode;
33 decode(mask, bl);
34 decode(names, bl);
35 /**
36 * Previously, there was a bug where insert did
37 * mask |= f.id rather than mask |= (1 << f.id).
38 * In FeatureSets from those version, mask always
39 * has the lowest bit set. Since then, masks always
40 * have the lowest bit unset.
41 *
42 * When we encounter such a FeatureSet, we have to
43 * reconstruct the mask from the names map.
44 */
45 if (mask & 1) {
46 mask = 1;
47 std::map<uint64_t, std::string> temp_names;
48 temp_names.swap(names);
49 for (auto i = temp_names.begin(); i != temp_names.end(); ++i) {
50 insert(Feature(i->first, i->second));
51 }
52 } else {
53 mask |= 1;
54 }
55}
56
57void CompatSet::FeatureSet::dump(ceph::Formatter *f) const {
58 for (auto p = names.cbegin(); p != names.cend(); ++p) {

Callers

nothing calls this directly

Calls 6

insertFunction · 0.85
FeatureClass · 0.85
decodeFunction · 0.70
swapMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected