X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fmds%2Fmdstypes.cc;h=a55c85590af87e0df644c307388f16c7e33bfbf0;hb=92f5a8d42d07f9929ae4fa7e01342fe8d96808a8;hp=20a2d2d5788017b1db50a5108268912247962443;hpb=a0324939f9d0e1905d5df8f57442f09dc70af83d;p=ceph.git diff --git a/ceph/src/mds/mdstypes.cc b/ceph/src/mds/mdstypes.cc index 20a2d2d57..a55c85590 100644 --- a/ceph/src/mds/mdstypes.cc +++ b/ceph/src/mds/mdstypes.cc @@ -433,6 +433,7 @@ void feature_bitset_t::decode(bufferlist::const_iterator &p) { void feature_bitset_t::print(ostream& out) const { std::ios_base::fmtflags f(out.flags()); + out << "0x"; for (int i = _vec.size() - 1; i >= 0; --i) out << std::setfill('0') << std::setw(sizeof(block_type) * 2) << std::hex << _vec[i]; @@ -462,8 +463,8 @@ void client_metadata_t::decode(bufferlist::const_iterator& p) void client_metadata_t::dump(Formatter *f) const { f->dump_stream("features") << features; - for (const auto& p : kv_map) - f->dump_string(p.first.c_str(), p.second); + for (const auto& [name, val] : kv_map) + f->dump_string(name.c_str(), val); } /* @@ -520,41 +521,33 @@ void session_info_t::dump(Formatter *f) const f->dump_stream("inst") << inst; f->open_array_section("completed_requests"); - for (map::const_iterator p = completed_requests.begin(); - p != completed_requests.end(); - ++p) { + for (const auto& [tid, ino] : completed_requests) { f->open_object_section("request"); - f->dump_unsigned("tid", p->first); - f->dump_stream("created_ino") << p->second; + f->dump_unsigned("tid", tid); + f->dump_stream("created_ino") << ino; f->close_section(); } f->close_section(); f->open_array_section("prealloc_inos"); - for (interval_set::const_iterator p = prealloc_inos.begin(); - p != prealloc_inos.end(); - ++p) { + for (const auto& [start, len] : prealloc_inos) { f->open_object_section("ino_range"); - f->dump_unsigned("start", p.get_start()); - f->dump_unsigned("length", p.get_len()); + f->dump_unsigned("start", start); + f->dump_unsigned("length", len); f->close_section(); } f->close_section(); f->open_array_section("used_inos"); - for (interval_set::const_iterator p = prealloc_inos.begin(); - p != prealloc_inos.end(); - ++p) { + for (const auto& [start, len] : used_inos) { f->open_object_section("ino_range"); - f->dump_unsigned("start", p.get_start()); - f->dump_unsigned("length", p.get_len()); + f->dump_unsigned("start", start); + f->dump_unsigned("length", len); f->close_section(); } f->close_section(); - f->open_array_section("client_metadata"); - client_metadata.dump(f); - f->close_section(); + f->dump_object("client_metadata", client_metadata); } void session_info_t::generate_test_instances(list& ls)