From 5b5d2ea4aebcbbe3fec349377337fe38f5a2f27a Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Tue, 28 May 2024 13:52:08 +0000 Subject: [PATCH] crimson/osd/object_context_loader: cleanup `loaded` Signed-off-by: Matan Breizman --- src/crimson/osd/object_context_loader.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/crimson/osd/object_context_loader.cc b/src/crimson/osd/object_context_loader.cc index 9af927806d5..79185a9460e 100644 --- a/src/crimson/osd/object_context_loader.cc +++ b/src/crimson/osd/object_context_loader.cc @@ -88,8 +88,8 @@ using crimson::common::local_conf; [existed=existed, clone=std::move(clone), func=std::move(func), head=std::move(head), this]() mutable -> load_obc_iertr::future<> { - auto loaded = get_or_load_obc(clone, existed); - return loaded.safe_then_interruptible( + return get_or_load_obc(clone, existed + ).safe_then_interruptible( [func = std::move(func), head=std::move(head)](auto clone) mutable { clone->set_clone_ssc(head->ssc); return std::move(func)(std::move(head), std::move(clone)); @@ -151,20 +151,17 @@ using crimson::common::local_conf; obc->invalidated_by_interval_change); return interruptor::with_lock(obc->loading_mutex, [this, obc, existed, FNAME] { - auto loaded = - load_obc_iertr::make_ready_future(obc); if (existed) { ceph_assert(obc->is_valid() && obc->is_loaded()); DEBUGDPP("cache hit on {}", dpp, obc->get_oid()); + return load_obc_iertr::make_ready_future(obc); } else { DEBUGDPP("cache miss on {}", dpp, obc->get_oid()); - loaded = - obc->template with_promoted_lock( + return obc->template with_promoted_lock( [obc, this] { return load_obc(obc); }); } - return loaded; }); } -- 2.39.5