]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: Add a void *pipe to Connection.
authorGreg Farnum <gregf@hq.newdream.net>
Thu, 15 Apr 2010 18:58:43 +0000 (11:58 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Thu, 15 Apr 2010 20:43:15 +0000 (13:43 -0700)
This is set on Connection creation and zeroed out in ~Pipe().

src/msg/Message.h
src/msg/SimpleMessenger.h

index fafed5127ac2acad5d0108b0471536d0cbf2020a..70cfdfab9b5bebe6352e8473a838e60eef9834c5 100644 (file)
@@ -163,9 +163,10 @@ struct Connection : public RefCountedObject {
   int peer_type;
   entity_addr_t peer_addr;
   unsigned features;
+  void *pipe;
 
 public:
-  Connection() : nref(1), lock("Connection::lock"), priv(NULL), peer_type(-1), features(0) {}
+  Connection() : nref(1), lock("Connection::lock"), priv(NULL), peer_type(-1), features(0), pipe(NULL) {}
   ~Connection() {
     //generic_dout(0) << "~Connection " << this << dendl;
     if (priv) {
index 9dce9b432de4930dbc341d5cf8759db203f5f9dc..657fe6b9de6d989d15c847bda24ecc63f61d004c 100644 (file)
@@ -183,7 +183,9 @@ private:
       in_qlen(0), keepalive(false),
       connect_seq(0), peer_global_seq(0),
       out_seq(0), in_seq(0), in_seq_acked(0),
-      reader_thread(this), writer_thread(this) { }
+      reader_thread(this), writer_thread(this) {
+      connection_state->pipe = this;
+    }
     ~Pipe() {
       for (map<int, xlist<Pipe *>::item* >::iterator i = queue_items.begin();
           i != queue_items.end();
@@ -194,6 +196,7 @@ private:
       }
       assert(out_q.empty());
       assert(sent.empty());
+      connection_state->pipe = NULL;
       connection_state->put();
     }