From: Adam C. Emerson Date: Tue, 8 Mar 2022 00:11:25 +0000 (-0500) Subject: osd: Fix implicit capture of this warnings X-Git-Tag: v18.0.0~366^2~9 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e56880027a998c93b2833a45001990156f6083d0;p=ceph.git osd: Fix implicit capture of this warnings Signed-off-by: Adam C. Emerson --- diff --git a/src/osd/PG.h b/src/osd/PG.h index 0b0cdfc5c559b..740d355b6cbf8 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -265,7 +265,7 @@ public: void set_last_scrub_stamp(utime_t t) { recovery_state.update_stats( - [=](auto &history, auto &stats) { + [t](auto &history, auto &stats) { set_last_scrub_stamp(t, history, stats); return true; }); @@ -279,7 +279,7 @@ public: void set_last_deep_scrub_stamp(utime_t t) { recovery_state.update_stats( - [=](auto &history, auto &stats) { + [t](auto &history, auto &stats) { set_last_deep_scrub_stamp(t, history, stats); return true; }); @@ -292,7 +292,7 @@ public: void add_objects_scrubbed_count(int64_t count) { recovery_state.update_stats( - [=](auto &history, auto &stats) { + [count](auto &history, auto &stats) { add_objects_scrubbed_count(count, stats); return true; }); @@ -304,7 +304,7 @@ public: void reset_objects_scrubbed() { - recovery_state.update_stats([=](auto& history, auto& stats) { + recovery_state.update_stats([](auto& history, auto& stats) { reset_objects_scrubbed(stats); return true; }); diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 218224f0b9c23..69e8a4961d956 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -154,7 +154,7 @@ void PGBackend::handle_recovery_delete(OpRequestRef op) ConnectionRef conn = m->get_connection(); gather.set_finisher(new LambdaContext( - [=](int r) { + [=, this](int r) { if (r != -EAGAIN) { get_parent()->send_message_osd_cluster(reply, conn.get()); } else { diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index bf44e7e3901a1..47265c169334e 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -12318,7 +12318,7 @@ int PrimaryLogPG::recover_missing( recovering.insert(make_pair(soid, ObjectContextRef())); epoch_t cur_epoch = get_osdmap_epoch(); remove_missing_object(soid, v, new LambdaContext( - [=](int) { + [=, this](int) { std::scoped_lock locker{*this}; if (!pg_has_reset_since(cur_epoch)) { bool object_missing = false; @@ -12401,7 +12401,7 @@ void PrimaryLogPG::remove_missing_object(const hobject_t &soid, epoch_t cur_epoch = get_osdmap_epoch(); t.register_on_complete(new LambdaContext( - [=](int) { + [=, this](int) { std::unique_lock locker{*this}; if (!pg_has_reset_since(cur_epoch)) { ObjectStore::Transaction t2; @@ -12564,7 +12564,7 @@ void PrimaryLogPG::do_update_log_missing(OpRequestRef &op) eversion_t new_lcod = info.last_complete; Context *complete = new LambdaContext( - [=](int) { + [=, this](int) { const MOSDPGUpdateLogMissing *msg = static_cast( op->get_req()); std::scoped_lock locker{*this}; @@ -15300,7 +15300,7 @@ bool PrimaryLogPG::agent_choose_mode(bool restart, OpRequestRef op) << TierAgentState::get_flush_mode_name(flush_mode) << dendl; recovery_state.update_stats( - [=](auto &history, auto &stats) { + [=, this](auto &history, auto &stats) { if (flush_mode == TierAgentState::FLUSH_MODE_HIGH) { osd->agent_inc_high_count(); stats.stats.sum.num_flush_mode_high = 1; @@ -15336,7 +15336,7 @@ bool PrimaryLogPG::agent_choose_mode(bool restart, OpRequestRef op) requeued = true; } recovery_state.update_stats( - [=](auto &history, auto &stats) { + [=, this](auto &history, auto &stats) { if (evict_mode == TierAgentState::EVICT_MODE_SOME) { stats.stats.sum.num_evict_mode_some = 1; } else if (evict_mode == TierAgentState::EVICT_MODE_FULL) { diff --git a/src/osd/scrubber/PrimaryLogScrub.cc b/src/osd/scrubber/PrimaryLogScrub.cc index fb610fde74c82..a868dd55e340f 100644 --- a/src/osd/scrubber/PrimaryLogScrub.cc +++ b/src/osd/scrubber/PrimaryLogScrub.cc @@ -117,7 +117,7 @@ void PrimaryLogScrub::_scrub_finish() << " m_is_repair: " << m_is_repair << dendl; if (info.stats.stats_invalid) { - m_pl_pg->recovery_state.update_stats([=](auto& history, auto& stats) { + m_pl_pg->recovery_state.update_stats([=, this](auto& history, auto& stats) { stats.stats = m_scrub_cstat; stats.stats_invalid = false; return false;