]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: capture variables explicitly 47367/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:47:14 +0000 (19:47 +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 0b0cdfc5c559b864bf19db502e47d69112c4798d..0ecd80a07c24cc3878d787e5913cda3962257815 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);
     });
   }