From: Kefu Chai Date: Sat, 30 Jul 2022 11:18:40 +0000 (+0800) Subject: osd/PG: capture variables explicitly X-Git-Tag: v18.0.0~377^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f5fc9b869aec246dfd5efe7fd2c0b6d5f79545cb;p=ceph.git osd/PG: capture variables explicitly 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 --- 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); }); }