From: Matan Breizman Date: Sun, 19 Feb 2023 10:49:47 +0000 (+0000) Subject: crimson/osd: Remove head memeber from ObjectContext X-Git-Tag: v18.1.0~87^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=87f05bbd3119cae44b3ef05e25495b4e2d771702;p=ceph.git crimson/osd: Remove head memeber from ObjectContext 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 (cherry picked from commit e702dc39606bfcc3899307453a6b54af11b8b803) --- diff --git a/src/crimson/osd/object_context.h b/src/crimson/osd/object_context.h index 48b28ae665f3..10cfc667abac 100644 --- a/src/crimson/osd/object_context.h +++ b/src/crimson/osd/object_context.h @@ -62,7 +62,6 @@ class ObjectContext : public ceph::common::intrusive_lru_base< hobject_t, ObjectContext, obc_to_hoid>> { 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 @@ -81,21 +80,14 @@ public: 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) { diff --git a/src/crimson/osd/object_context_loader.cc b/src/crimson/osd/object_context_loader.cc index 23aa00a33531..72612b9ccd95 100644 --- a/src/crimson/osd/object_context_loader.cc +++ b/src/crimson/osd/object_context_loader.cc @@ -73,7 +73,6 @@ using crimson::common::local_conf; func=std::move(func), head=std::move(head), this]() -> load_obc_iertr::future<> { auto loaded = get_or_load_obc(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)); diff --git a/src/crimson/osd/ops_executer.cc b/src/crimson/osd/ops_executer.cc index 6306a0ac1d73..5e0c442fe7ff 100644 --- a/src/crimson/osd/ops_executer.cc +++ b/src/crimson/osd/ops_executer.cc @@ -1036,7 +1036,6 @@ std::pair OpsExecuter::prepare_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); }