From: Matan Breizman Date: Wed, 3 Aug 2022 11:36:45 +0000 (+0000) Subject: crimson/osd/pg: with_clone_obc: avoid coid capture X-Git-Tag: v18.0.0~197^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=405f822518f6a46b22bd969d2e4592697421dc4e;p=ceph.git crimson/osd/pg: with_clone_obc: avoid coid capture Signed-off-by: Matan Breizman --- diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 92f9e8b6e469..c6c3f42b9eb3 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -1060,18 +1060,17 @@ PG::with_clone_obc(hobject_t oid, with_obc_func_t&& func) } auto [clone, existed] = shard_services.get_cached_obc(*coid); return clone->template with_lock( - [coid=*coid, existed=existed, - head=std::move(head), clone=std::move(clone), + [existed=existed, head=std::move(head), clone=std::move(clone), func=std::move(func), this]() -> load_obc_iertr::future<> { auto loaded = load_obc_iertr::make_ready_future(clone); if (existed) { - logger().debug("with_clone_obc: found {} in cache", coid); + logger().debug("with_clone_obc: found {} in cache", clone->get_oid()); } else { - logger().debug("with_clone_obc: cache miss on {}", coid); + logger().debug("with_clone_obc: cache miss on {}", clone->get_oid()); loaded = clone->template with_promoted_lock( - [coid, clone, head, this] { - return backend->load_metadata(coid).safe_then_interruptible( - [coid, clone=std::move(clone), head=std::move(head)](auto md) mutable { + [clone, head, this] { + return backend->load_metadata(clone->get_oid()).safe_then_interruptible( + [clone=std::move(clone), head=std::move(head)](auto md) mutable { clone->set_clone_state(std::move(md->os), std::move(head)); return clone; });