Before this patch, ObjectContext had a head member which was used
to get the head obc of a clone object.
This member caused the head object to being referenced while
attempting to 'clear_replica_obc' (Since we only evict un-referenced
obc from the obc_registery).
This mechanism, of obtaining the head, is no longer needed since
'with_clone_obc' loads the head object context first (using
oid.get_head).
In this commit, head is removed from ObjectContext class and users
are removed as well.
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
hobject_t, ObjectContext, obc_to_hoid<ObjectContext>>>
{
public:
- Ref head; // Ref defined as part of ceph::common::intrusive_lru_base
ObjectState obs;
SnapSetContextRef ssc;
// the watch / notify machinery rather stays away from the hot and
return get_oid().is_head();
}
- Ref get_head_obc() const {
- return head;
- }
-
hobject_t get_head_oid() const {
return get_oid().get_head();
}
const SnapSet &get_ro_ss() const {
- if (is_head()) {
- ceph_assert(ssc);
- return ssc->snapset;
- } else {
- return head->get_ro_ss();
- }
+ ceph_assert(is_head());
+ ceph_assert(ssc);
+ return ssc->snapset;
}
void set_head_state(ObjectState &&_obs, SnapSetContextRef &&_ssc) {
func=std::move(func), head=std::move(head), this]()
-> load_obc_iertr::future<> {
auto loaded = get_or_load_obc<State>(clone, existed);
- clone->head = std::move(head);
return loaded.safe_then_interruptible(
[func = std::move(func)](auto clone) {
return std::move(func)(std::move(clone));
c_obc->obs.oi = static_snap_oi;
c_obc->obs.exists = true;
c_obc->ssc = obc->ssc;
- c_obc->head = obc->head;
logger().debug("clone_obc: {}", c_obc->obs.oi);
clone_obc = std::move(c_obc);
}