From: Matan Breizman Date: Tue, 28 May 2024 13:52:08 +0000 (+0000) Subject: crimson/osd/object_context_loader: cleanup `loaded` X-Git-Tag: v20.0.0~1802^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5b5d2ea4aebcbbe3fec349377337fe38f5a2f27a;p=ceph.git crimson/osd/object_context_loader: cleanup `loaded` Signed-off-by: Matan Breizman --- diff --git a/src/crimson/osd/object_context_loader.cc b/src/crimson/osd/object_context_loader.cc index 9af927806d56..79185a9460e9 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; }); }