]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/object_context_loader: Simplify with_obc
authorMatan Breizman <mbreizma@redhat.com>
Sun, 7 Apr 2024 12:23:56 +0000 (12:23 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Mon, 22 Apr 2024 08:33:28 +0000 (08:33 +0000)
No change in behavior

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/osd/object_context_loader.cc
src/crimson/osd/object_context_loader.h

index 351bb3b46dea5b4defdc61f679b9e76aa1e7e252..699f1c4728d4638238f2f3076b8941d587909ebe 100644 (file)
@@ -9,11 +9,11 @@ using crimson::common::local_conf;
 
   template<RWState::State State>
   ObjectContextLoader::load_obc_iertr::future<>
-  ObjectContextLoader::with_head_obc(ObjectContextRef obc,
-                                     bool existed,
+  ObjectContextLoader::with_head_obc(const hobject_t& oid,
                                      with_obc_func_t&& func)
   {
     LOG_PREFIX(ObjectContextLoader::with_head_obc);
+    auto [obc, existed] = obc_registry.get_cached_obc(oid);
     DEBUGDPP("object {}", dpp, obc->get_oid());
     assert(obc->is_head());
     obc->append_to(obc_set_accessing);
@@ -36,7 +36,7 @@ using crimson::common::local_conf;
 
   template<RWState::State State>
   ObjectContextLoader::load_obc_iertr::future<>
-  ObjectContextLoader::with_clone_obc(hobject_t oid,
+  ObjectContextLoader::with_clone_obc(const hobject_t& oid,
                                       with_obc_func_t&& func)
   {
     LOG_PREFIX(ObjectContextLoader::with_clone_obc);
@@ -97,11 +97,7 @@ using crimson::common::local_conf;
                                 with_obc_func_t&& func)
   {
     if (oid.is_head()) {
-      auto [obc, existed] =
-        obc_registry.get_cached_obc(std::move(oid));
-      return with_head_obc<State>(std::move(obc),
-                                  existed,
-                                  std::move(func));
+      return with_head_obc<State>(oid, std::move(func));
     } else {
       return with_clone_obc<State>(oid, std::move(func));
     }
index a594f3db975e6de71ad890353577c5d17485eed6..1d9c3bb90a276bdcfcb400e38a5fd88913311f9f 100644 (file)
@@ -59,12 +59,11 @@ private:
   obc_accessing_list_t obc_set_accessing;
 
   template<RWState::State State>
-  load_obc_iertr::future<> with_clone_obc(hobject_t oid,
+  load_obc_iertr::future<> with_clone_obc(const hobject_t& oid,
                                           with_obc_func_t&& func);
 
   template<RWState::State State>
-  load_obc_iertr::future<> with_head_obc(ObjectContextRef obc,
-                                         bool existed,
+  load_obc_iertr::future<> with_head_obc(const hobject_t& oid,
                                          with_obc_func_t&& func);
 
   template<RWState::State State>