]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: capture variables explicitly 45133/head
authorKefu Chai <tchaikov@gmail.com>
Sat, 30 Jul 2022 11:18:40 +0000 (19:18 +0800)
committerKefu Chai <tchaikov@gmail.com>
Sat, 30 Jul 2022 11:46:42 +0000 (19:46 +0800)
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 <tchaikov@gmail.com>
src/osd/PG.h

index 740d355b6cbf83fe53ce21c00d0c551d3ae651e5..11850ada6bc9773852466608dd035bc9f4d4f8be 100644 (file)
@@ -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);
     });
   }