Both ReplicatedPG::lookup_object_context and
ReplicatedPG::_lookup_object_context methods are provided by
SharedPtrRegistry.
http://tracker.ceph.com/issues/5510 refs #5510
Signed-off-by: Loic Dachary <loic@dachary.org>
eval_repop(repop);
}
-ObjectContext *ReplicatedPG::_lookup_object_context(const hobject_t& oid)
-{
- map<hobject_t, ObjectContext*>::iterator p = object_contexts.find(oid);
- if (p != object_contexts.end())
- return p->second;
- return NULL;
-}
-
ObjectContextRef ReplicatedPG::create_object_context(const object_info_t& oi,
SnapSetContext *ssc)
{
handle.reset_tp_timeout();
ObjectContextRef obc;
if (is_primary())
- obc = _lookup_object_context(*p);
+ obc = object_contexts.lookup(*p);
if (obc) {
bi->objects[*p] = obc->obs.oi.version;
dout(20) << " " << *p << " " << obc->obs.oi.version << dendl;
void handle_watch_timeout(WatchRef watch);
protected:
- ObjectContext *lookup_object_context(const hobject_t& soid) {
- if (object_contexts.count(soid)) {
- ObjectContext *obc = object_contexts[soid];
- obc->ref++;
- return obc;
- }
- return NULL;
- }
- ObjectContext *_lookup_object_context(const hobject_t& oid);
ObjectContextRef create_object_context(const object_info_t& oi, SnapSetContext *ssc);
ObjectContextRef get_object_context(const hobject_t& soid, bool can_create);