From f5fc9b869aec246dfd5efe7fd2c0b6d5f79545cb Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 30 Jul 2022 19:18:40 +0800 Subject: [PATCH] osd/PG: capture variables explicitly MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit to silence warning if compiled with -std=c++20: src/osd/PG.h:571:7: warning: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Wdeprecated] 571 | [=](auto &history, auto &stats) { | ^ Signed-off-by: Kefu Chai --- src/osd/PG.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osd/PG.h b/src/osd/PG.h index 0b0cdfc5c55..0ecd80a07c2 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -557,7 +557,7 @@ public: void add_objects_trimmed_count(int64_t count) { recovery_state.update_stats_wo_resched( - [=](auto &history, auto &stats) { + [count](auto &history, auto &stats) { add_objects_trimmed_count(count, stats); }); } @@ -568,7 +568,7 @@ public: void reset_objects_trimmed() { recovery_state.update_stats_wo_resched( - [=](auto &history, auto &stats) { + [](auto &history, auto &stats) { reset_objects_trimmed(stats); }); } @@ -583,7 +583,7 @@ public: utime_t cur_stamp = ceph_clock_now(); utime_t duration = cur_stamp - snaptrim_begin_stamp; recovery_state.update_stats_wo_resched( - [=](auto &history, auto &stats) { + [duration](auto &history, auto &stats) { stats.snaptrim_duration = double(duration); }); } -- 2.39.5