]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/.../object_context_loader: remove impossible branch in get_or_load_obc
authorSamuel Just <sjust@redhat.com>
Sat, 8 Jun 2024 00:31:53 +0000 (00:31 +0000)
committerSamuel Just <sjust@redhat.com>
Fri, 21 Jun 2024 22:24:57 +0000 (15:24 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/osd/object_context_loader.cc

index 3f3f78964c4390750c52babc76ea6d7d7a8fd075..97e26e50deded25c6572900cedd9e3357566922d 100644 (file)
@@ -158,20 +158,11 @@ using crimson::common::local_conf;
     // See ObjectContext::_with_lock(),
     // this function must be able to support atomicity before
     // acquiring the lock
-    if (obc->loading_mutex.try_lock()) {
-      return _get_or_load_obc<State>(obc, existed
-      ).finally([obc]{
-        obc->loading_mutex.unlock();
-      });
-    } else {
-      return interruptor::with_lock(obc->loading_mutex,
-      [this, obc, existed, FNAME] {
-        // Previous user already loaded the obc
-        DEBUGDPP("{} finished waiting for loader, cache hit on {}",
-                 dpp, FNAME, obc->get_oid());
-        return get_obc(obc, existed);
-      });
-    }
+    ceph_assert(obc->loading_mutex.try_lock());
+    return _get_or_load_obc<State>(obc, existed
+    ).finally([obc]{
+      obc->loading_mutex.unlock();
+    });
   }
 
   template<RWState::State State>