3 void FSMapUser::encode(bufferlist& bl, uint64_t features) const
5 ENCODE_START(1, 1, bl);
7 ::encode(legacy_client_fscid, bl);
8 std::vector<fs_info_t> fs_list;
9 for (auto p = filesystems.begin(); p != filesystems.end(); ++p)
10 fs_list.push_back(p->second);
11 ::encode(fs_list, bl, features);
15 void FSMapUser::decode(bufferlist::iterator& p)
19 ::decode(legacy_client_fscid, p);
20 std::vector<fs_info_t> fs_list;
23 for (auto p = fs_list.begin(); p != fs_list.end(); ++p)
24 filesystems[p->cid] = *p;
28 void FSMapUser::fs_info_t::encode(bufferlist& bl, uint64_t features) const
30 ENCODE_START(1, 1, bl);
36 void FSMapUser::fs_info_t::decode(bufferlist::iterator& p)
44 void FSMapUser::generate_test_instances(list<FSMapUser*>& ls)
46 FSMapUser *m = new FSMapUser();
48 m->legacy_client_fscid = 1;
49 m->filesystems[1].cid = 1;
50 m->filesystems[2].name = "cephfs2";
51 m->filesystems[2].cid = 2;
52 m->filesystems[1].name = "cephfs1";
57 void FSMapUser::print(ostream& out) const
59 out << "e" << epoch << std::endl;
60 out << "legacy_client_fscid: " << legacy_client_fscid << std::endl;
61 for (auto &p : filesystems)
62 out << " id " << p.second.cid << " name " << p.second.name << std::endl;
65 void FSMapUser::print_summary(Formatter *f, ostream *out)
67 map<mds_role_t,string> by_rank;
68 map<string,int> by_state;
71 f->dump_unsigned("epoch", get_epoch());
72 for (auto &p : filesystems) {
73 f->dump_unsigned("id", p.second.cid);
74 f->dump_string("name", p.second.name);
77 *out << "e" << get_epoch() << ":";
78 for (auto &p : filesystems)
79 *out << " " << p.second.name << "(" << p.second.cid << ")";