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

Method _insert

src/mgr/DaemonState.cc:232–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void DaemonStateIndex::_insert(DaemonStatePtr dm)
233{
234 if (all.count(dm->key)) {
235 _erase(dm->key);
236 }
237
238 by_server[dm->hostname][dm->key] = dm;
239 all[dm->key] = dm;
240
241 for (auto& i : dm->devices) {
242 auto d = _get_or_create_device(i.first);
243 d->daemons.insert(dm->key);
244 auto p = dm->devices_bypath.find(i.first);
245 if (p != dm->devices_bypath.end()) {
246 d->attachments.insert(std::make_tuple(dm->hostname, i.second, p->second));
247 } else {
248 d->attachments.insert(std::make_tuple(dm->hostname, i.second,
249 std::string()));
250 }
251 }
252}
253
254void DaemonStateIndex::_erase(const DaemonKey& dmk)
255{

Callers

nothing calls this directly

Calls 4

countMethod · 0.45
insertMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected