]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: set MonClient::_add_conn return type to void 37329/head
authorChangcheng Liu <changcheng.liu@aliyun.com>
Tue, 22 Sep 2020 07:15:07 +0000 (15:15 +0800)
committerChangcheng Liu <changcheng.liu@aliyun.com>
Tue, 22 Sep 2020 07:15:07 +0000 (15:15 +0800)
The new created MonConnection are refered through
MonClient::pending_cons instead of through the return
value.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
src/mon/MonClient.cc
src/mon/MonClient.h

index 6859bc220efa93b2b01e8b472fdac1eb4b366db7..edff5f509586a58e44e6541430c6048fb80f7dc2 100644 (file)
@@ -741,17 +741,16 @@ void MonClient::_reopen_session(int rank)
   }
 }
 
-MonConnection& MonClient::_add_conn(unsigned rank, uint64_t global_id)
+void MonClient::_add_conn(unsigned rank, uint64_t global_id)
 {
   auto peer = monmap.get_addrs(rank);
   auto conn = messenger->connect_to_mon(peer);
   MonConnection mc(cct, conn, global_id, &auth_registry);
-  auto inserted = pending_cons.insert(std::make_pair(peer, std::move(mc)));
+  pending_cons.insert(std::make_pair(peer, std::move(mc)));
   ldout(cct, 10) << "picked mon." << monmap.get_name(rank)
                  << " con " << conn
                  << " addr " << peer
                  << dendl;
-  return inserted.first->second;
 }
 
 void MonClient::_add_conns(uint64_t global_id)
index e079213c23b9772940fca3669383a670124e3b17..c7f245feec4fd3a3be51defd478f14978db447be 100644 (file)
@@ -351,7 +351,7 @@ private:
   void _finish_hunting(int auth_err);
   void _finish_auth(int auth_err);
   void _reopen_session(int rank = -1);
-  MonConnection& _add_conn(unsigned rank, uint64_t global_id);
+  void _add_conn(unsigned rank, uint64_t global_id);
   void _un_backoff();
   void _add_conns(uint64_t global_id);
   void _send_mon_message(MessageRef m);