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

Method dump_cache

src/mds/SnapClient.cc:324–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322}
323
324int SnapClient::dump_cache(Formatter *f) const
325{
326 if (!is_synced()) {
327 dout(5) << "dump_cache: not synced" << dendl;
328 return -EINVAL;
329 }
330
331 map<snapid_t, const SnapInfo*> snaps;
332 for (auto& p : cached_snaps)
333 snaps[p.first] = &p.second;
334
335 for (auto tid : committing_tids) {
336 auto q = cached_pending_update.find(tid);
337 if (q != cached_pending_update.end())
338 snaps[q->second.snapid] = &q->second;
339
340 auto r = cached_pending_destroy.find(tid);
341 if (r != cached_pending_destroy.end())
342 snaps.erase(r->second.first);
343 }
344
345 f->open_object_section("snapclient");
346
347 f->dump_int("last_created", get_last_created());
348 f->dump_int("last_destroyed", get_last_destroyed());
349
350 f->open_array_section("snaps");
351 for (auto p : snaps) {
352 f->open_object_section("snap");
353 p.second->dump(f);
354 f->close_section();
355 }
356 f->close_section();
357
358 f->close_section();
359
360 return 0;
361}

Callers

nothing calls this directly

Calls 8

findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
open_object_sectionMethod · 0.45
dump_intMethod · 0.45
open_array_sectionMethod · 0.45
dumpMethod · 0.45
close_sectionMethod · 0.45

Tested by

no test coverage detected