]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/Connection: track peer_id (id portion of entity_name_t) for msgr2
authorSage Weil <sage@redhat.com>
Sun, 20 Jan 2019 22:47:38 +0000 (16:47 -0600)
committerSage Weil <sage@redhat.com>
Thu, 7 Feb 2019 12:53:03 +0000 (06:53 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/msg/Connection.h

index b9bddc2c6606222cd5fd7e6a7bb429fe5b2dddca..0f7c764a52825f1d844e0a9fff12038cd29715a2 100644 (file)
@@ -43,6 +43,7 @@ struct Connection : public RefCountedObject {
   Messenger *msgr;
   RefCountedPtr priv;
   int peer_type;
+  int64_t peer_id = -1;  // [msgr2 only] the 0 of osd.0, 4567 or client.4567
   safe_item_history<entity_addrvec_t> peer_addrs;
   utime_t last_keepalive, last_keepalive_ack;
 private:
@@ -172,6 +173,10 @@ public:
   int get_peer_type() const { return peer_type; }
   void set_peer_type(int t) { peer_type = t; }
 
+  // peer_id is only defined for msgr2
+  int64_t get_peer_id() const { return peer_id; }
+  void set_peer_id(int64_t t) { peer_id = t; }
+
   bool peer_is_mon() const { return peer_type == CEPH_ENTITY_TYPE_MON; }
   bool peer_is_mgr() const { return peer_type == CEPH_ENTITY_TYPE_MGR; }
   bool peer_is_mds() const { return peer_type == CEPH_ENTITY_TYPE_MDS; }