]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: remove useless SimpleMessenger::msgr
authorSage Weil <sage@inktank.com>
Sat, 11 Aug 2012 14:28:32 +0000 (07:28 -0700)
committerSage Weil <sage@inktank.com>
Mon, 13 Aug 2012 15:46:14 +0000 (08:46 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/msg/SimpleMessenger.cc
src/msg/SimpleMessenger.h

index 75fecb5714fa26f3ba4c3932026d877b7e3a03ca..b50a44cd7d0be7921bbc765e7ffff3d1f882d83e 100644 (file)
@@ -25,7 +25,7 @@
 
 #define dout_subsys ceph_subsys_ms
 #undef dout_prefix
-#define dout_prefix _prefix(_dout, msgr)
+#define dout_prefix _prefix(_dout, this)
 static ostream& _prefix(std::ostream *_dout, SimpleMessenger *msgr) {
   return *_dout << "-- " << msgr->get_myaddr() << " ";
 }
@@ -49,8 +49,7 @@ SimpleMessenger::SimpleMessenger(CephContext *cct, entity_name_t name,
     dispatch_throttler(cct, string("msgr_dispatch_throttler-") + mname, cct->_conf->ms_dispatch_throttle_bytes),
     reaper_started(false), reaper_stop(false),
     timeout(0),
-    local_connection(new Connection),
-    msgr(this)
+    local_connection(new Connection)
 {
   pthread_spin_init(&global_seq_lock, PTHREAD_PROCESS_PRIVATE);
   init_local_connection();
@@ -184,8 +183,8 @@ void SimpleMessenger::dispatch_throttle_release(uint64_t msize)
 {
   if (msize) {
     ldout(cct,10) << "dispatch_throttle_release " << msize << " to dispatch throttler "
-           << msgr->dispatch_throttler.get_current() << "/"
-           << msgr->dispatch_throttler.get_max() << dendl;
+           << dispatch_throttler.get_current() << "/"
+           << dispatch_throttler.get_max() << dendl;
     dispatch_throttler.put(msize);
   }
 }
@@ -257,7 +256,7 @@ int SimpleMessenger::bind(entity_addr_t bind_addr)
   // bind to a socket
   int r = accepter.bind(bind_addr);
   if (r >= 0)
-    msgr->did_bind = true;
+    did_bind = true;
   return r;
 }
 
@@ -301,7 +300,7 @@ Pipe *SimpleMessenger::add_accept_pipe(int sd)
   p->pipe_lock.Lock();
   p->start_reader();
   p->pipe_lock.Unlock();
-  msgr->pipes.insert(p);
+  pipes.insert(p);
   lock.Unlock();
   return p;
 }
@@ -645,6 +644,6 @@ void SimpleMessenger::learned_addr(const entity_addr_t &peer_addr_for_me)
 
 void SimpleMessenger::init_local_connection()
 {
-  local_connection->peer_addr = msgr->my_inst.addr;
-  local_connection->peer_type = msgr->my_type;
+  local_connection->peer_addr = my_inst.addr;
+  local_connection->peer_type = my_type;
 }
index 41ddc5537b4c44aa314b1125226f047483c3976d..cc10c2762f96c2839482a178f2f0c029c5e80b84 100644 (file)
@@ -529,8 +529,6 @@ public:
   /// con used for sending messages to ourselves
   Connection *local_connection;
 
-  SimpleMessenger *msgr; //hack to make dout macro work, will fix
-
   /**
    * @defgroup SimpleMessenger internals
    * @{