]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: Remove head memeber from ObjectContext
authorMatan Breizman <mbreizma@redhat.com>
Sun, 19 Feb 2023 10:49:47 +0000 (10:49 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 7 Mar 2023 09:04:07 +0000 (09:04 +0000)
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>
src/crimson/osd/object_context.h
src/crimson/osd/object_context_loader.cc
src/crimson/osd/ops_executer.cc

index 48b28ae665f3fed2dcaee3229f110c1c9d919eb3..10cfc667abaca9fb551197648aed4b8fc009103b 100644 (file)
@@ -62,7 +62,6 @@ class ObjectContext : public ceph::common::intrusive_lru_base<
     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
@@ -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) {
index 23aa00a335312193d0a11490d3de5b98f4d4675b..72612b9ccd9595b1fb53a5bdaa5287b23c886433 100644 (file)
@@ -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<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));
index 6306a0ac1d73abafc06a8436f3ea1a2d2238aca2..5e0c442fe7ff595c37296bedb35f569b086489ac 100644 (file)
@@ -1036,7 +1036,6 @@ std::pair<object_info_t, ObjectContextRef> 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);
   }