diff options
author | Changcheng Liu <changcheng.liu@aliyun.com> | 2020-09-17 07:15:44 +0200 |
---|---|---|
committer | Changcheng Liu <changcheng.liu@aliyun.com> | 2020-09-21 03:22:07 +0200 |
commit | 4d6b678736e9afee3a0a2556ec5af874e32078bf (patch) | |
tree | 7c6724a8c29ed6c5a54666a73ff62c24868c4c01 | |
parent | Merge pull request #37072 from idryomov/wip-kcephfs-blacklisted-string (diff) | |
download | ceph-4d6b678736e9afee3a0a2556ec5af874e32078bf.tar.xz ceph-4d6b678736e9afee3a0a2556ec5af874e32078bf.zip |
messenger: remove unused variable
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
-rw-r--r-- | src/ceph_mds.cc | 3 | ||||
-rw-r--r-- | src/ceph_mon.cc | 7 | ||||
-rw-r--r-- | src/ceph_osd.cc | 25 | ||||
-rw-r--r-- | src/mgr/DaemonServer.cc | 3 | ||||
-rw-r--r-- | src/mgr/MgrStandby.cc | 3 | ||||
-rw-r--r-- | src/msg/Messenger.cc | 4 | ||||
-rw-r--r-- | src/msg/Messenger.h | 12 | ||||
-rw-r--r-- | src/test/crimson/test_async_echo.cc | 7 | ||||
-rw-r--r-- | src/test/crimson/test_messenger_peer.cc | 4 | ||||
-rw-r--r-- | src/test/fio/fio_ceph_messenger.cc | 7 | ||||
-rw-r--r-- | src/test/mon/test-mon-msg.cc | 2 | ||||
-rw-r--r-- | src/test/mon/test_mon_workloadgen.cc | 2 | ||||
-rw-r--r-- | src/test/msgr/perf_msgr_client.cc | 2 | ||||
-rw-r--r-- | src/test/msgr/perf_msgr_server.cc | 2 | ||||
-rw-r--r-- | src/test/msgr/test_msgr.cc | 10 | ||||
-rw-r--r-- | src/test/osd/TestOSDScrub.cc | 2 | ||||
-rw-r--r-- | src/tools/crimson/perf_async_msgr.cc | 2 |
17 files changed, 31 insertions, 66 deletions
diff --git a/src/ceph_mds.cc b/src/ceph_mds.cc index 6e0327af85e..b5674befc86 100644 --- a/src/ceph_mds.cc +++ b/src/ceph_mds.cc @@ -166,8 +166,7 @@ int main(int argc, const char **argv) std::string public_msgr_type = g_conf()->ms_public_type.empty() ? g_conf().get_val<std::string>("ms_type") : g_conf()->ms_public_type; Messenger *msgr = Messenger::create(g_ceph_context, public_msgr_type, entity_name_t::MDS(-1), "mds", - Messenger::get_random_nonce(), - Messenger::HAS_MANY_CONNECTIONS); + Messenger::get_random_nonce()); if (!msgr) forker.exit(1); msgr->set_cluster_protocol(CEPH_MDS_PROTOCOL); diff --git a/src/ceph_mon.cc b/src/ceph_mon.cc index ff2ad22efd3..71c53d6dbca 100644 --- a/src/ceph_mon.cc +++ b/src/ceph_mon.cc @@ -790,9 +790,7 @@ int main(int argc, const char **argv) int rank = monmap.get_rank(g_conf()->name.get_id()); std::string public_msgr_type = g_conf()->ms_public_type.empty() ? g_conf().get_val<std::string>("ms_type") : g_conf()->ms_public_type; Messenger *msgr = Messenger::create(g_ceph_context, public_msgr_type, - entity_name_t::MON(rank), "mon", - 0, // zero nonce - Messenger::HAS_MANY_CONNECTIONS); + entity_name_t::MON(rank), "mon", 0); if (!msgr) exit(1); msgr->set_cluster_protocol(CEPH_MON_PROTOCOL); @@ -843,8 +841,7 @@ int main(int argc, const char **argv) Messenger *mgr_msgr = Messenger::create(g_ceph_context, public_msgr_type, entity_name_t::MON(rank), "mon-mgrc", - Messenger::get_pid_nonce(), - 0); + Messenger::get_pid_nonce()); if (!mgr_msgr) { derr << "unable to create mgr_msgr" << dendl; prefork.exit(1); diff --git a/src/ceph_osd.cc b/src/ceph_osd.cc index 0a178962646..c75abf83877 100644 --- a/src/ceph_osd.cc +++ b/src/ceph_osd.cc @@ -538,30 +538,19 @@ flushjournal_out: cluster_msg_type = cluster_msg_type.empty() ? msg_type : cluster_msg_type; uint64_t nonce = Messenger::get_pid_nonce(); Messenger *ms_public = Messenger::create(g_ceph_context, public_msg_type, - entity_name_t::OSD(whoami), "client", - nonce, - Messenger::HAS_HEAVY_TRAFFIC | - Messenger::HAS_MANY_CONNECTIONS); + entity_name_t::OSD(whoami), "client", nonce); Messenger *ms_cluster = Messenger::create(g_ceph_context, cluster_msg_type, - entity_name_t::OSD(whoami), "cluster", - nonce, - Messenger::HAS_HEAVY_TRAFFIC | - Messenger::HAS_MANY_CONNECTIONS); + entity_name_t::OSD(whoami), "cluster", nonce); Messenger *ms_hb_back_client = Messenger::create(g_ceph_context, cluster_msg_type, - entity_name_t::OSD(whoami), "hb_back_client", - nonce, Messenger::HEARTBEAT); + entity_name_t::OSD(whoami), "hb_back_client", nonce); Messenger *ms_hb_front_client = Messenger::create(g_ceph_context, public_msg_type, - entity_name_t::OSD(whoami), "hb_front_client", - nonce, Messenger::HEARTBEAT); + entity_name_t::OSD(whoami), "hb_front_client", nonce); Messenger *ms_hb_back_server = Messenger::create(g_ceph_context, cluster_msg_type, - entity_name_t::OSD(whoami), "hb_back_server", - nonce, Messenger::HEARTBEAT); + entity_name_t::OSD(whoami), "hb_back_server", nonce); Messenger *ms_hb_front_server = Messenger::create(g_ceph_context, public_msg_type, - entity_name_t::OSD(whoami), "hb_front_server", - nonce, Messenger::HEARTBEAT); + entity_name_t::OSD(whoami), "hb_front_server", nonce); Messenger *ms_objecter = Messenger::create(g_ceph_context, public_msg_type, - entity_name_t::OSD(whoami), "ms_objecter", - nonce, 0); + entity_name_t::OSD(whoami), "ms_objecter", nonce); if (!ms_public || !ms_cluster || !ms_hb_front_client || !ms_hb_back_client || !ms_hb_back_server || !ms_hb_front_server || !ms_objecter) forker.exit(1); ms_cluster->set_cluster_protocol(CEPH_OSD_PROTOCOL); diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index 502496ab456..87c293c924a 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -111,8 +111,7 @@ int DaemonServer::init(uint64_t gid, entity_addrvec_t client_addrs) msgr = Messenger::create(g_ceph_context, public_msgr_type, entity_name_t::MGR(gid), "mgr", - Messenger::get_pid_nonce(), - 0); + Messenger::get_pid_nonce()); msgr->set_default_policy(Messenger::Policy::stateless_server(0)); msgr->set_auth_client(monc); diff --git a/src/mgr/MgrStandby.cc b/src/mgr/MgrStandby.cc index 7a84c59061e..e72edd72d97 100644 --- a/src/mgr/MgrStandby.cc +++ b/src/mgr/MgrStandby.cc @@ -44,8 +44,7 @@ MgrStandby::MgrStandby(int argc, const char **argv) : cct->_conf.get_val<std::string>("ms_type"), entity_name_t::MGR(), "mgr", - Messenger::get_pid_nonce(), - 0)), + Messenger::get_pid_nonce())), objecter{g_ceph_context, client_messenger.get(), &monc, poolctx, 0, 0}, client{client_messenger.get(), &monc, &objecter}, mgrc(g_ceph_context, client_messenger.get(), &monc.monmap), diff --git a/src/msg/Messenger.cc b/src/msg/Messenger.cc index 464ba394666..8064a10a0d9 100644 --- a/src/msg/Messenger.cc +++ b/src/msg/Messenger.cc @@ -15,7 +15,7 @@ Messenger *Messenger::create_client_messenger(CephContext *cct, std::string lnam std::string public_msgr_type = cct->_conf->ms_public_type.empty() ? cct->_conf.get_val<std::string>("ms_type") : cct->_conf->ms_public_type; auto nonce = get_random_nonce(); return Messenger::create(cct, public_msgr_type, entity_name_t::CLIENT(), - std::move(lname), nonce, 0); + std::move(lname), nonce); } uint64_t Messenger::get_pid_nonce() @@ -35,7 +35,7 @@ uint64_t Messenger::get_random_nonce() Messenger *Messenger::create(CephContext *cct, const std::string &type, entity_name_t name, std::string lname, - uint64_t nonce, uint64_t cflags) + uint64_t nonce) { int r = -1; if (type == "random") { diff --git a/src/msg/Messenger.h b/src/msg/Messenger.h index 46071f0ddd4..a3836d3c1e2 100644 --- a/src/msg/Messenger.h +++ b/src/msg/Messenger.h @@ -118,14 +118,6 @@ public: #endif /** - * Various Messenger conditional config/type flags to allow - * different "transport" Messengers to tune themselves - */ - static const int HAS_HEAVY_TRAFFIC = 0x0001; - static const int HAS_MANY_CONNECTIONS = 0x0002; - static const int HEARTBEAT = 0x0004; - - /** * The CephContext this Messenger uses. Many other components initialize themselves * from this value. */ @@ -165,14 +157,12 @@ public: * @param lname logical name of the messenger in this process (e.g., "client") * @param nonce nonce value to uniquely identify this instance on the current host * @param features bits for the local connection - * @param cflags general std::set of flags to configure transport resources */ static Messenger *create(CephContext *cct, const std::string &type, entity_name_t name, std::string lname, - uint64_t nonce, - uint64_t cflags); + uint64_t nonce); static uint64_t get_random_nonce(); static uint64_t get_pid_nonce(); diff --git a/src/test/crimson/test_async_echo.cc b/src/test/crimson/test_async_echo.cc index c9a4e907308..4f2d43d9d29 100644 --- a/src/test/crimson/test_async_echo.cc +++ b/src/test/crimson/test_async_echo.cc @@ -24,8 +24,7 @@ struct Server { Server(CephContext* cct, const entity_inst_t& entity) : dummy_auth(cct), dispatcher(cct) { - msgr.reset(Messenger::create(cct, "async", - entity.name, "pong", entity.addr.get_nonce(), 0)); + msgr.reset(Messenger::create(cct, "async", entity.name, "pong", entity.addr.get_nonce())); dummy_auth.auth_registry.refresh_config(); msgr->set_cluster_protocol(CEPH_OSD_PROTOCOL); msgr->set_default_policy(Messenger::Policy::stateless_server(0)); @@ -84,9 +83,7 @@ struct Client { Client(CephContext *cct) : dummy_auth(cct), dispatcher(cct) { - msgr.reset(Messenger::create(cct, "async", - entity_name_t::CLIENT(-1), "ping", - getpid(), 0)); + msgr.reset(Messenger::create(cct, "async", entity_name_t::CLIENT(-1), "ping", getpid())); dummy_auth.auth_registry.refresh_config(); msgr->set_cluster_protocol(CEPH_OSD_PROTOCOL); msgr->set_default_policy(Messenger::Policy::lossy_client(0)); diff --git a/src/test/crimson/test_messenger_peer.cc b/src/test/crimson/test_messenger_peer.cc index 17e693a3927..7b669675ba3 100644 --- a/src/test/crimson/test_messenger_peer.cc +++ b/src/test/crimson/test_messenger_peer.cc @@ -105,7 +105,7 @@ class FailoverSuitePeer : public Dispatcher { private: void init(entity_addr_t test_peer_addr, SocketPolicy policy) { - peer_msgr.reset(Messenger::create(cct, "async", entity_name_t::OSD(4), "TestPeer", 4, 0)); + peer_msgr.reset(Messenger::create(cct, "async", entity_name_t::OSD(4), "TestPeer", 4)); dummy_auth.auth_registry.refresh_config(); peer_msgr->set_cluster_protocol(CEPH_OSD_PROTOCOL); peer_msgr->set_default_policy(policy); @@ -362,7 +362,7 @@ class FailoverTestPeer : public Dispatcher { } void init(entity_addr_t cmd_peer_addr) { - cmd_msgr.reset(Messenger::create(cct, "async", entity_name_t::OSD(3), "CmdSrv", 3, 0)); + cmd_msgr.reset(Messenger::create(cct, "async", entity_name_t::OSD(3), "CmdSrv", 3)); dummy_auth.auth_registry.refresh_config(); cmd_msgr->set_cluster_protocol(CEPH_OSD_PROTOCOL); cmd_msgr->set_default_policy(Messenger::Policy::stateless_server(0)); diff --git a/src/test/fio/fio_ceph_messenger.cc b/src/test/fio/fio_ceph_messenger.cc index 49c8e12e0c1..4a4cf4fb575 100644 --- a/src/test/fio/fio_ceph_messenger.cc +++ b/src/test/fio/fio_ceph_messenger.cc @@ -291,11 +291,6 @@ static Messenger *create_messenger(struct ceph_msgr_options *o) std::string lname = o->is_receiver ? "receiver" : "sender"; - /* Does anybody really uses those flags in messenger? Seems not. */ - unsigned flags = o->is_receiver ? - Messenger::HAS_HEAVY_TRAFFIC | - Messenger::HAS_MANY_CONNECTIONS : 0; - std::string ms_type = o->ms_type != CEPH_MSGR_TYPE_UNDEF ? ceph_msgr_types[o->ms_type] : g_ceph_context->_conf.get_val<std::string>("ms_type"); @@ -303,7 +298,7 @@ static Messenger *create_messenger(struct ceph_msgr_options *o) /* o->td__>pid doesn't set value, so use getpid() instead*/ auto nonce = o->is_receiver ? 0 : (getpid() + o->td__->thread_number); Messenger *msgr = Messenger::create(g_ceph_context, ms_type.c_str(), - ename, lname, nonce, flags); + ename, lname, nonce); if (o->is_receiver) { msgr->set_default_policy(Messenger::Policy::stateless_server(0)); msgr->bind(hostname_to_addr(o)); diff --git a/src/test/mon/test-mon-msg.cc b/src/test/mon/test-mon-msg.cc index 4c551cab810..fede9df8f15 100644 --- a/src/test/mon/test-mon-msg.cc +++ b/src/test/mon/test-mon-msg.cc @@ -84,7 +84,7 @@ public: std::string public_msgr_type = cct->_conf->ms_public_type.empty() ? cct->_conf.get_val<std::string>("ms_type") : cct->_conf->ms_public_type; msg = Messenger::create(cct, public_msgr_type, entity_name_t::CLIENT(-1), - "test-mon-msg", 0, 0); + "test-mon-msg", 0); ceph_assert(msg != NULL); msg->set_default_policy(Messenger::Policy::lossy_client(0)); dout(0) << __func__ << " starting messenger at " diff --git a/src/test/mon/test_mon_workloadgen.cc b/src/test/mon/test_mon_workloadgen.cc index 613a18f247e..64f7bed5e97 100644 --- a/src/test/mon/test_mon_workloadgen.cc +++ b/src/test/mon/test_mon_workloadgen.cc @@ -362,7 +362,7 @@ class OSDStub : public TestStub ss << "client-osd" << whoami; std::string public_msgr_type = cct->_conf->ms_public_type.empty() ? cct->_conf.get_val<std::string>("ms_type") : cct->_conf->ms_public_type; messenger.reset(Messenger::create(cct, public_msgr_type, entity_name_t::OSD(whoami), - ss.str().c_str(), getpid(), 0)); + ss.str().c_str(), getpid())); Throttle throttler(g_ceph_context, "osd_client_bytes", g_conf()->osd_client_message_size_cap); diff --git a/src/test/msgr/perf_msgr_client.cc b/src/test/msgr/perf_msgr_client.cc index cb342755678..0e5c5ab367f 100644 --- a/src/test/msgr/perf_msgr_client.cc +++ b/src/test/msgr/perf_msgr_client.cc @@ -136,7 +136,7 @@ class MessengerClient { addr.set_nonce(0); dummy_auth.auth_registry.refresh_config(); for (int i = 0; i < jobs; ++i) { - Messenger *msgr = Messenger::create(g_ceph_context, type, entity_name_t::CLIENT(0), "client", getpid()+i, 0); + Messenger *msgr = Messenger::create(g_ceph_context, type, entity_name_t::CLIENT(0), "client", getpid()+i); msgr->set_default_policy(Messenger::Policy::lossless_client(0)); msgr->set_auth_client(&dummy_auth); msgr->start(); diff --git a/src/test/msgr/perf_msgr_server.cc b/src/test/msgr/perf_msgr_server.cc index 4a8e182fc1c..f17f90f6d08 100644 --- a/src/test/msgr/perf_msgr_server.cc +++ b/src/test/msgr/perf_msgr_server.cc @@ -116,7 +116,7 @@ class MessengerServer { MessengerServer(const string &t, const string &addr, int threads, int delay): msgr(NULL), type(t), bindaddr(addr), dispatcher(threads, delay), dummy_auth(g_ceph_context) { - msgr = Messenger::create(g_ceph_context, type, entity_name_t::OSD(0), "server", 0, 0); + msgr = Messenger::create(g_ceph_context, type, entity_name_t::OSD(0), "server", 0); msgr->set_default_policy(Messenger::Policy::stateless_server(0)); dummy_auth.auth_registry.refresh_config(); msgr->set_auth_server(&dummy_auth); diff --git a/src/test/msgr/test_msgr.cc b/src/test/msgr/test_msgr.cc index 4ddcafabeb5..3ebe320be11 100644 --- a/src/test/msgr/test_msgr.cc +++ b/src/test/msgr/test_msgr.cc @@ -71,8 +71,8 @@ class MessengerTest : public ::testing::TestWithParam<const char*> { } void SetUp() override { lderr(g_ceph_context) << __func__ << " start set up " << GetParam() << dendl; - server_msgr = Messenger::create(g_ceph_context, string(GetParam()), entity_name_t::OSD(0), "server", getpid(), 0); - client_msgr = Messenger::create(g_ceph_context, string(GetParam()), entity_name_t::CLIENT(-1), "client", getpid(), 0); + server_msgr = Messenger::create(g_ceph_context, string(GetParam()), entity_name_t::OSD(0), "server", getpid()); + client_msgr = Messenger::create(g_ceph_context, string(GetParam()), entity_name_t::CLIENT(-1), "client", getpid()); server_msgr->set_default_policy(Messenger::Policy::stateless_server(0)); client_msgr->set_default_policy(Messenger::Policy::lossy_client(0)); server_msgr->set_auth_client(&dummy_auth); @@ -1787,7 +1787,7 @@ class SyntheticWorkload { char addr[64]; for (int i = 0; i < servers; ++i) { msgr = Messenger::create(g_ceph_context, type, entity_name_t::OSD(0), - "server", getpid()+i, 0); + "server", getpid()+i); snprintf(addr, sizeof(addr), "v2:127.0.0.1:%d", base_port+i); bind_addr.parse(addr); @@ -1804,7 +1804,7 @@ class SyntheticWorkload { for (int i = 0; i < clients; ++i) { msgr = Messenger::create(g_ceph_context, type, entity_name_t::CLIENT(-1), - "client", getpid()+i+servers, 0); + "client", getpid()+i+servers); if (cli_policy.standby) { snprintf(addr, sizeof(addr), "v2:127.0.0.1:%d", base_port+i+servers); @@ -2270,7 +2270,7 @@ class MarkdownDispatcher : public Dispatcher { // Markdown with external lock TEST_P(MessengerTest, MarkdownTest) { - Messenger *server_msgr2 = Messenger::create(g_ceph_context, string(GetParam()), entity_name_t::OSD(0), "server", getpid(), 0); + Messenger *server_msgr2 = Messenger::create(g_ceph_context, string(GetParam()), entity_name_t::OSD(0), "server", getpid()); MarkdownDispatcher cli_dispatcher(false), srv_dispatcher(true); DummyAuthClientServer dummy_auth(g_ceph_context); dummy_auth.auth_registry.refresh_config(); diff --git a/src/test/osd/TestOSDScrub.cc b/src/test/osd/TestOSDScrub.cc index b61a83dde08..4e37c474d37 100644 --- a/src/test/osd/TestOSDScrub.cc +++ b/src/test/osd/TestOSDScrub.cc @@ -62,7 +62,7 @@ TEST(TestOSDScrub, scrub_time_permit) { std::string cluster_msgr_type = g_conf()->ms_cluster_type.empty() ? g_conf().get_val<std::string>("ms_type") : g_conf()->ms_cluster_type; Messenger *ms = Messenger::create(g_ceph_context, cluster_msgr_type, entity_name_t::OSD(0), "make_checker", - getpid(), 0); + getpid()); ms->set_cluster_protocol(CEPH_OSD_PROTOCOL); ms->set_default_policy(Messenger::Policy::stateless_server(0)); ms->bind(g_conf()->public_addr); diff --git a/src/tools/crimson/perf_async_msgr.cc b/src/tools/crimson/perf_async_msgr.cc index 77ffcee0a11..25d1d410e49 100644 --- a/src/tools/crimson/perf_async_msgr.cc +++ b/src/tools/crimson/perf_async_msgr.cc @@ -19,7 +19,7 @@ struct Server { Server(CephContext* cct, unsigned msg_len) : dummy_auth(cct), dispatcher(cct, msg_len) { - msgr.reset(Messenger::create(cct, "async", entity_name_t::OSD(0), "server", 0, 0)); + msgr.reset(Messenger::create(cct, "async", entity_name_t::OSD(0), "server", 0)); dummy_auth.auth_registry.refresh_config(); msgr->set_cluster_protocol(CEPH_OSD_PROTOCOL); msgr->set_default_policy(Messenger::Policy::stateless_server(0)); |