From 986e79951b1538c4ed4bd181d2f1240a88b1c306 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 10 Jun 2019 17:25:45 -0700 Subject: [PATCH] crimson/net/Connection: add priv member for osd to use Signed-off-by: Samuel Just --- src/crimson/net/Connection.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/crimson/net/Connection.h b/src/crimson/net/Connection.h index 986ba437548fa..a8a7f43a1951f 100644 --- a/src/crimson/net/Connection.h +++ b/src/crimson/net/Connection.h @@ -78,6 +78,27 @@ class Connection : public seastar::enable_shared_from_this { } auto get_last_keepalive() const { return last_keepalive; } auto get_last_keepalive_ack() const { return last_keepalive_ack; } + + seastar::shared_ptr get_shared() { + return shared_from_this(); + } + + struct user_private_t { + virtual ~user_private_t() = default; + }; +private: + unique_ptr user_private; +public: + bool has_user_private() const { + return user_private != nullptr; + } + void set_user_private(unique_ptr new_user_private) { + user_private = std::move(new_user_private); + } + user_private_t &get_user_private() { + ceph_assert(user_private); + return *user_private; + } }; inline ostream& operator<<(ostream& out, const Connection& conn) { -- 2.39.5