From: Sage Weil Date: Sun, 20 Jan 2019 22:47:38 +0000 (-0600) Subject: msg/Connection: track peer_id (id portion of entity_name_t) for msgr2 X-Git-Tag: v14.1.0~183^2~48 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5bd92c29d9df45a23bd3ad1b3378120a21186b29;p=ceph-ci.git msg/Connection: track peer_id (id portion of entity_name_t) for msgr2 Signed-off-by: Sage Weil --- diff --git a/src/msg/Connection.h b/src/msg/Connection.h index b9bddc2c660..0f7c764a528 100644 --- a/src/msg/Connection.h +++ b/src/msg/Connection.h @@ -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 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; }