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

Method command_dump_dir

src/mds/MDSRank.cc:3623–3657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3621}
3622
3623void MDSRank::command_dump_dir(Formatter *f, const cmdmap_t &cmdmap, std::ostream &ss)
3624{
3625 std::lock_guard l(mds_lock);
3626 std::string path;
3627 bool got = cmd_getval(cmdmap, "path", path);
3628 if (!got) {
3629 ss << "missing path argument";
3630 return;
3631 }
3632
3633 bool dentry_dump = false;
3634 cmd_getval(cmdmap, "dentry_dump", dentry_dump);
3635
3636 CInode *in = mdcache->cache_traverse(filepath(path.c_str()));
3637 if (!in) {
3638 ss << "directory inode not in cache";
3639 return;
3640 }
3641
3642 f->open_array_section("dirs");
3643 frag_vec_t leaves;
3644 in->dirfragtree.get_leaves_under(frag_t(), leaves);
3645 for (const auto& leaf : leaves) {
3646 CDir *dir = in->get_dirfrag(leaf);
3647 if (dir) {
3648 mdcache->dump_dir(f, dir, dentry_dump);
3649 } else {
3650 f->open_object_section("frag");
3651 f->dump_stream("frag") << leaf;
3652 f->dump_string("status", "dirfrag not in cache");
3653 f->close_section();
3654 }
3655 }
3656 f->close_section();
3657}
3658
3659void MDSRank::dump_status(Formatter *f) const
3660{

Callers

nothing calls this directly

Calls 13

frag_tClass · 0.85
cache_traverseMethod · 0.80
get_leaves_underMethod · 0.80
dump_dirMethod · 0.80
filepathClass · 0.70
cmd_getvalFunction · 0.50
c_strMethod · 0.45
open_array_sectionMethod · 0.45
get_dirfragMethod · 0.45
open_object_sectionMethod · 0.45
dump_streamMethod · 0.45
dump_stringMethod · 0.45

Tested by

no test coverage detected