Cosmetic ceph_mds.cc.

Signed-off-by: Matt Benjamin <matt@cohortfs.com>
This commit is contained in:
Matt Benjamin 2014-12-23 16:29:52 -05:00
parent d53b378ea0
commit fd5cd938d2

View File

@ -145,18 +145,19 @@ int main(int argc, const char **argv)
usage();
}
if (g_conf->name.get_id().empty() || (g_conf->name.get_id()[0] >= '0' && g_conf->name.get_id()[0] <= '9')) {
if (g_conf->name.get_id().empty() ||
(g_conf->name.get_id()[0] >= '0' && g_conf->name.get_id()[0] <= '9')) {
derr << "deprecation warning: MDS id '" << g_conf->name
<< "' is invalid and will be forbidden in a future version. "
"MDS names may not start with a numeric digit." << dendl;
}
Messenger *messenger = Messenger::create(g_ceph_context, g_conf->ms_type,
entity_name_t::MDS(-1), "mds",
getpid());
messenger->set_cluster_protocol(CEPH_MDS_PROTOCOL);
Messenger *msgr = Messenger::create(g_ceph_context, g_conf->ms_type,
entity_name_t::MDS(-1), "mds",
getpid());
msgr->set_cluster_protocol(CEPH_MDS_PROTOCOL);
cout << "starting " << g_conf->name << " at " << messenger->get_myaddr()
cout << "starting " << g_conf->name << " at " << msgr->get_myaddr()
<< std::endl;
uint64_t supported =
CEPH_FEATURE_UID |
@ -169,18 +170,19 @@ int main(int argc, const char **argv)
CEPH_FEATURE_MDS_QUOTA;
uint64_t required =
CEPH_FEATURE_OSDREPLYMUX;
messenger->set_default_policy(Messenger::Policy::lossy_client(supported, required));
messenger->set_policy(entity_name_t::TYPE_MON,
Messenger::Policy::lossy_client(supported,
CEPH_FEATURE_UID |
CEPH_FEATURE_PGID64));
messenger->set_policy(entity_name_t::TYPE_MDS,
Messenger::Policy::lossless_peer(supported,
CEPH_FEATURE_UID));
messenger->set_policy(entity_name_t::TYPE_CLIENT,
Messenger::Policy::stateful_server(supported, 0));
int r = messenger->bind(g_conf->public_addr);
msgr->set_default_policy(Messenger::Policy::lossy_client(supported, required));
msgr->set_policy(entity_name_t::TYPE_MON,
Messenger::Policy::lossy_client(supported,
CEPH_FEATURE_UID |
CEPH_FEATURE_PGID64));
msgr->set_policy(entity_name_t::TYPE_MDS,
Messenger::Policy::lossless_peer(supported,
CEPH_FEATURE_UID));
msgr->set_policy(entity_name_t::TYPE_CLIENT,
Messenger::Policy::stateful_server(supported, 0));
int r = msgr->bind(g_conf->public_addr);
if (r < 0)
exit(1);
@ -194,10 +196,10 @@ int main(int argc, const char **argv)
return -1;
global_init_chdir(g_ceph_context);
messenger->start();
msgr->start();
// start mds
mds = new MDS(g_conf->name.get_id().c_str(), messenger, &mc);
mds = new MDS(g_conf->name.get_id().c_str(), msgr, &mc);
// in case we have to respawn...
mds->orig_argc = argc;
@ -219,7 +221,7 @@ int main(int argc, const char **argv)
if (g_conf->inject_early_sigterm)
kill(getpid(), SIGTERM);
messenger->wait();
msgr->wait();
unregister_async_signal_handler(SIGHUP, sighup_handler);
unregister_async_signal_handler(SIGINT, handle_mds_signal);