Otherwise, accessing the pg via _applied_recovered_object
isn't safe. Using intrusive_ptr clarifies the reference
ownership.
Signed-off-by: Samuel Just <sam.just@inktank.com>
return false;
}
+
+void boost::intrusive_ptr_add_ref(PG *pg) { pg->get(); }
+void boost::intrusive_ptr_release(PG *pg) { pg->put(); }
ostream& operator<<(ostream& out, const PG& pg);
+namespace boost {
+ void intrusive_ptr_add_ref(PG *pg);
+ void intrusive_ptr_release(PG *pg);
+};
+
#endif
}
};
struct C_OSD_AppliedRecoveredObject : public Context {
- ReplicatedPG *pg;
+ boost::intrusive_ptr<ReplicatedPG> pg;
ObjectStore::Transaction *t;
ObjectContext *obc;
C_OSD_AppliedRecoveredObject(ReplicatedPG *p, ObjectStore::Transaction *tt, ObjectContext *o) :