]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
{common,osd,mds,rbd}: Remove unused captures 19657/head
authorAdam C. Emerson <aemerson@redhat.com>
Sat, 23 Dec 2017 00:36:09 +0000 (19:36 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 8 Jan 2018 20:30:05 +0000 (15:30 -0500)
If we aren't referencing a variable, don't capture it. (This makes the
lambdas smaller, too, modulo Sufficiently Smart Compiler.)

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/common/Throttle.h
src/mds/MDBalancer.cc
src/mds/MDCache.cc
src/mds/MDSRank.cc
src/mon/MgrStatMonitor.cc
src/mon/MonmapMonitor.cc
src/osd/PrimaryLogPG.cc
src/test/librbd/io/test_mock_ObjectRequest.cc
src/test/librbd/test_librbd.cc
src/test/rbd_mirror/test_mock_ImageSync.cc

index 9081c006b77476cadc6f37fad9d431c6bc3609f3..8c6d13afeec231288f4882a6e1e8524278bff0cf 100644 (file)
@@ -384,7 +384,7 @@ public:
     uint64_t got = m_throttle.get(c);
     if (got < c) {
       // Not enough tokens, add a blocker for it.
-      Context *ctx = new FunctionContext([this, handler, item](int r) {
+      Context *ctx = new FunctionContext([handler, item](int r) {
        (handler->*MF)(r, item);
         });
       m_blockers.emplace_back(c - got, ctx);
index 4801f8f5abf01bfbac1ee70f6cb533e7c1465b7f..88fdc722fa9097be009de6c8270bad29600cf5a3 100644 (file)
@@ -1292,7 +1292,7 @@ int MDBalancer::dump_loads(Formatter *f)
   f->open_object_section("mds_load");
   {
 
-    auto dump_mds_load = [this, f, now](mds_load_t& load) {
+    auto dump_mds_load = [f, now](mds_load_t& load) {
       f->dump_float("request_rate", load.req_rate);
       f->dump_float("cache_hit_rate", load.cache_hit_rate);
       f->dump_float("queue_length", load.queue_len);
index c58ce5d6520de7806e9788b092a4d56a04a20289..7803df70e7ac353ef2106aab3315483d70e2014f 100644 (file)
@@ -11985,7 +11985,7 @@ int MDCache::dump_cache(const char *fn, Formatter *f,
     }
   }
 
-  auto dump_func = [this, fd, f, depth, &dump_root](CInode *in) {
+  auto dump_func = [fd, f, depth, &dump_root](CInode *in) {
     int r;
     if (!dump_root.empty()) {
       string ipath;
index fe4aaf269665df94c0bd02f00eef4f3754655dfd..59c9d5e0b508947359470b673a6af6ff3116ccf0 100644 (file)
@@ -1365,7 +1365,7 @@ void MDSRank::reconnect_start()
   objecter->enable_blacklist_events();
   std::set<entity_addr_t> blacklist;
   epoch_t epoch = 0;
-  objecter->with_osdmap([this, &blacklist, &epoch](const OSDMap& o) {
+  objecter->with_osdmap([&blacklist, &epoch](const OSDMap& o) {
       o.get_blacklist(&blacklist);
       epoch = o.get_epoch();
   });
@@ -2743,7 +2743,7 @@ bool MDSRank::evict_client(int64_t session_id,
     Context *on_blacklist_done = new FunctionContext([this, session_id, fn](int r) {
       objecter->wait_for_latest_osdmap(
        new C_OnFinisher(
-         new FunctionContext([this, session_id, fn](int r) {
+         new FunctionContext([this, fn](int r) {
               Mutex::Locker l(mds_lock);
               auto epoch = objecter->with_osdmap([](const OSDMap &o){
                   return o.get_epoch();
@@ -2760,7 +2760,7 @@ bool MDSRank::evict_client(int64_t session_id,
     monc->start_mon_command(cmd, {}, nullptr, nullptr, on_blacklist_done);
   };
 
-  auto blocking_blacklist = [this, cmd, &err_ss, background_blacklist](){
+  auto blocking_blacklist = [this, cmd, background_blacklist](){
     C_SaferCond inline_ctx;
     background_blacklist([&inline_ctx](){inline_ctx.complete(0);});
     mds_lock.Unlock();
index 0d4ca3e7e10ed127dd37ec5cae2f9aaa553b1b0c..471f9748cd7db314723da8de297b3f355e09e8aa 100644 (file)
@@ -265,7 +265,7 @@ void MgrStatMonitor::check_sub(Subscription *sub)
     auto m = new MServiceMap(service_map);
     sub->session->con->send_message(m);
     if (sub->onetime) {
-      mon->with_session_map([this, sub](MonSessionMap& session_map) {
+      mon->with_session_map([sub](MonSessionMap& session_map) {
          session_map.remove_sub(sub);
        });
     } else {
index 88e5e1731a36ae37dd4c018583c0ada8917bc88d..f84c930e5df3da5dd35ea4070cc7244492d16792 100644 (file)
@@ -769,7 +769,7 @@ void MonmapMonitor::check_sub(Subscription *sub)
   if (sub->next <= epoch) {
     mon->send_latest_monmap(sub->session->con.get());
     if (sub->onetime) {
-      mon->with_session_map([this, sub](MonSessionMap& session_map) {
+      mon->with_session_map([sub](MonSessionMap& session_map) {
          session_map.remove_sub(sub);
        });
     } else {
index f06deacf222a6b186a6f4dacc91989a7addb4433..0e8c473dcda291ed1da773f9957dc2306498950e 100644 (file)
@@ -3845,7 +3845,7 @@ void PrimaryLogPG::execute_ctx(OpContext *ctx)
        ConnectionRef());
     });
   ctx->register_on_finish(
-    [ctx, this]() {
+    [ctx]() {
       delete ctx;
     });
 
index 6f0425029ec06b6b743d158227bef3da8d8d2327..09c48f0dc70b8d7a14c8e55d2fa158420ca09f10 100644 (file)
@@ -208,8 +208,7 @@ struct TestMockIoObjectRequest : public TestMockFixture {
 
   void expect_copyup(MockCopyupRequest& mock_copyup_request, int r) {
     EXPECT_CALL(mock_copyup_request, send())
-      .WillOnce(Invoke([&mock_copyup_request, r]() {
-                }));
+      .WillOnce(Invoke([]() {}));
   }
 
   void expect_copyup(MockCopyupRequest& mock_copyup_request,
index 5968f42c2a1377ccd79129474b99f6f8e379688e..7d019b4333f411f0f988149dd187c4e15cd463a6 100644 (file)
@@ -6172,7 +6172,7 @@ TEST_F(TestLibRBD, ExclusiveLock)
 
   int owner_id = -1;
   mutex lock;
-  const auto pingpong = [&,this](int m_id, rbd_image_t &m_image) {
+  const auto pingpong = [&](int m_id, rbd_image_t &m_image) {
       for (int i = 0; i < 10; i++) {
        {
          lock_guard<mutex> locker(lock);
index aed32bbfb48b7c403f64ce670d55680dfb923572..69c141df60cb777898f1e521f8eab473efb909e7 100644 (file)
@@ -330,14 +330,14 @@ TEST_F(TestMockImageSync, CancelNotifySyncRequest) {
   C_SaferCond notify_sync_ctx;
   EXPECT_CALL(mock_instance_watcher,
               notify_sync_request(mock_local_image_ctx.id, _))
-    .WillOnce(Invoke([this, &on_sync_start, &notify_sync_ctx](
+    .WillOnce(Invoke([&on_sync_start, &notify_sync_ctx](
                          const std::string &, Context *ctx) {
                        on_sync_start = ctx;
                        notify_sync_ctx.complete(0);
                      }));
   EXPECT_CALL(mock_instance_watcher,
               cancel_sync_request(mock_local_image_ctx.id))
-    .WillOnce(Invoke([this, &on_sync_start](const std::string &) {
+    .WillOnce(Invoke([&on_sync_start](const std::string &) {
           EXPECT_NE(nullptr, on_sync_start);
           on_sync_start->complete(-ECANCELED);
           return true;