]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: silence -Wunused-variable warning 27809/head
authorKefu Chai <kchai@redhat.com>
Sun, 28 Apr 2019 15:31:31 +0000 (23:31 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 28 Apr 2019 16:12:57 +0000 (00:12 +0800)
silence warning like

/home/kchai/ceph/src/crimson/osd/heartbeat.cc:314:24: warning: unused
variable ‘peer’ [-Wunused-variable]
       auto& [peer, info] = item;
                        ^

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/heartbeat.cc
src/crimson/osd/pg.cc

index 4a1f04a7758464e323c33f6990a2b743f549f364..c983ebe6aff45a78013609290b8b30bc890b6a73 100644 (file)
@@ -311,14 +311,14 @@ seastar::future<> Heartbeat::send_heartbeats()
       const auto now = clock::now();
       const auto deadline =
         now + std::chrono::seconds(local_conf()->osd_heartbeat_grace);
-      auto& [peer, info] = item;
+      auto& info = item.second;
       info.last_tx = now;
       if (clock::is_zero(info.first_tx)) {
         info.first_tx = now;
       }
       const utime_t sent_stamp{now};
-      auto [reply, added] = info.ping_history.emplace(sent_stamp,
-                                                      reply_t{deadline, 0});
+      [[maybe_unused]] auto [reply, added] =
+        info.ping_history.emplace(sent_stamp, reply_t{deadline, 0});
       std::vector<ceph::net::ConnectionRef> conns{info.con_front,
                                                   info.con_back};
       return seastar::parallel_for_each(std::move(conns),
index 868522945bbf914f590bb613a05189d2ceea307e..a7a0daf09e9ed7d54b97713f9e50dc02f8bc50cf 100644 (file)
@@ -409,7 +409,7 @@ PG::find_best_info(const PG::peer_info_t& infos) const
   // when you find bugs!
   auto min_last_update_acceptable = eversion_t::max();
   epoch_t max_les = 0;
-  for (auto& [shard, info] : infos) {
+  for ([[maybe_unused]] auto& [shard, info] : infos) {
     if (max_les < info.history.last_epoch_started) {
       max_les = info.history.last_epoch_started;
     }
@@ -418,7 +418,7 @@ PG::find_best_info(const PG::peer_info_t& infos) const
       max_les = info.last_epoch_started;
     }
   }
-  for (auto& [shard, info] : infos) {
+  for ([[maybe_unused]] auto& [shard, info] : infos) {
     if (max_les <= info.last_epoch_started &&
         min_last_update_acceptable > info.last_update) {
       min_last_update_acceptable = info.last_update;