mirror of
https://github.com/ceph/ceph
synced 2025-01-19 09:32:00 +00:00
Merge pull request #1095 from ceph/wip-7166
osd: OSDMap: build reverse name->pool map upon decoding Reviewed-by: Loic Dachary <loic@dachary.org>
This commit is contained in:
commit
d27731fece
@ -1721,12 +1721,7 @@ void OSDMap::decode_classic(bufferlist::iterator& p)
|
||||
else
|
||||
osd_addrs->hb_front_addr.resize(osd_addrs->hb_back_addr.size());
|
||||
|
||||
// index pool names
|
||||
name_pool.clear();
|
||||
for (map<int64_t,string>::iterator i = pool_name.begin(); i != pool_name.end(); ++i)
|
||||
name_pool[i->second] = i->first;
|
||||
|
||||
calc_num_osds();
|
||||
post_decode();
|
||||
}
|
||||
|
||||
void OSDMap::decode(bufferlist::iterator& bl)
|
||||
@ -1793,6 +1788,20 @@ void OSDMap::decode(bufferlist::iterator& bl)
|
||||
}
|
||||
|
||||
DECODE_FINISH(bl); // wrapper
|
||||
|
||||
post_decode();
|
||||
}
|
||||
|
||||
void OSDMap::post_decode()
|
||||
{
|
||||
// index pool names
|
||||
name_pool.clear();
|
||||
for (map<int64_t,string>::iterator i = pool_name.begin();
|
||||
i != pool_name.end(); ++i) {
|
||||
name_pool[i->second] = i->first;
|
||||
}
|
||||
|
||||
calc_num_osds();
|
||||
}
|
||||
|
||||
void OSDMap::dump_json(ostream& out) const
|
||||
|
@ -475,6 +475,7 @@ private:
|
||||
void encode_client_old(bufferlist& bl) const;
|
||||
void encode_classic(bufferlist& bl, uint64_t features) const;
|
||||
void decode_classic(bufferlist::iterator& p);
|
||||
void post_decode();
|
||||
public:
|
||||
void encode(bufferlist& bl, uint64_t features=CEPH_FEATURES_ALL) const;
|
||||
void decode(bufferlist& bl);
|
||||
|
Loading…
Reference in New Issue
Block a user