From 6b8f7799335349074be706fe2e089afda6c9e84f Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Wed, 6 May 2020 03:17:15 -0400 Subject: [PATCH] mds: non-rank based interface for sending message to an mds Signed-off-by: Venky Shankar --- src/mds/MDSRank.cc | 10 ++++++++-- src/mds/MDSRank.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index c5c6359df3ec8..e49b515417cd2 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -1396,14 +1396,20 @@ void MDSRank::send_message_mds(const ref_t& m, mds_rank_t mds) } // send mdsmap first? + auto addrs = mdsmap->get_addrs(mds); if (mds != whoami && peer_mdsmap_epoch[mds] < mdsmap->get_epoch()) { auto _m = make_message(monc->get_fsid(), *mdsmap); - messenger->send_to_mds(_m.detach(), mdsmap->get_addrs(mds)); + send_message_mds(_m, addrs); peer_mdsmap_epoch[mds] = mdsmap->get_epoch(); } // send message - messenger->send_to_mds(ref_t(m).detach(), mdsmap->get_addrs(mds)); + send_message_mds(m, addrs); +} + +void MDSRank::send_message_mds(const ref_t& m, const entity_addrvec_t &addr) +{ + messenger->send_to_mds(ref_t(m).detach(), addr); } void MDSRank::forward_message_mds(const cref_t& m, mds_rank_t mds) diff --git a/src/mds/MDSRank.h b/src/mds/MDSRank.h index a657b1731be7e..45cf67ce0cbbf 100644 --- a/src/mds/MDSRank.h +++ b/src/mds/MDSRank.h @@ -267,6 +267,7 @@ class MDSRank { double get_dispatch_queue_max_age(utime_t now) const; void send_message_mds(const ref_t& m, mds_rank_t mds); + void send_message_mds(const ref_t& m, const entity_addrvec_t &addr); void forward_message_mds(const cref_t& req, mds_rank_t mds); void send_message_client_counted(const ref_t& m, client_t client); void send_message_client_counted(const ref_t& m, Session* session); -- 2.39.5