int mon = get_leader();
MonSession *session = 0;
if (req->get_connection())
- session = (MonSession *)req->get_connection()->get_priv();
+ session = static_cast<MonSession *>(req->get_connection()->get_priv());
if (req->session_mon >= 0) {
dout(10) << "forward_request won't double fwd request " << *req << dendl;
req->put();
rr->tid = ++routed_request_tid;
rr->client = req->get_source_inst();
encode_message(req, CEPH_FEATURES_ALL, rr->request_bl); // for my use only; use all features
- rr->session = (MonSession *)session->get();
+ rr->session = static_cast<MonSession *>(session->get());
routed_requests[rr->tid] = rr;
session->routed_request_tids.insert(rr->tid);
{
dout(10) << "received forwarded message from " << m->client
<< " via " << m->get_source_inst() << dendl;
- MonSession *session = (MonSession *)m->get_connection()->get_priv();
+ MonSession *session = static_cast<MonSession *>(m->get_connection()->get_priv());
assert(session);
if (!session->caps.check_privileges(PAXOS_MONMAP, MON_CAP_X)) {
void Monitor::send_reply(PaxosServiceMessage *req, Message *reply)
{
- MonSession *session = (MonSession*)req->get_connection()->get_priv();
+ MonSession *session = static_cast<MonSession*>(req->get_connection()->get_priv());
if (!session) {
dout(2) << "send_reply no session, dropping reply " << *reply
<< " to " << req << " " << *req << dendl;
void Monitor::no_reply(PaxosServiceMessage *req)
{
- MonSession *session = (MonSession*)req->get_connection()->get_priv();
+ MonSession *session = static_cast<MonSession*>(req->get_connection()->get_priv());
if (!session) {
dout(2) << "no_reply no session, dropping non-reply to " << req << " " << *req << dendl;
return;
void Monitor::handle_route(MRoute *m)
{
- MonSession *session = (MonSession *)m->get_connection()->get_priv();
+ MonSession *session = static_cast<MonSession *>(m->get_connection()->get_priv());
//check privileges
if (session && !session->caps.check_privileges(PAXOS_MONMAP, MON_CAP_X)) {
dout(0) << "MRoute received from entity without appropriate perms! "
if (connection) {
dout(20) << "have connection" << dendl;
- s = (MonSession *)connection->get_priv();
+ s = static_cast<MonSession *>(connection->get_priv());
if (s && s->closed) {
caps = s->caps;
reuse_caps = true;
switch (m->get_type()) {
case MSG_ROUTE:
- handle_route((MRoute*)m);
+ handle_route(static_cast<MRoute*>(m));
break;
// misc
case CEPH_MSG_MON_GET_MAP:
- handle_mon_get_map((MMonGetMap*)m);
+ handle_mon_get_map(static_cast<MMonGetMap*>(m));
break;
case CEPH_MSG_MON_GET_VERSION:
- handle_get_version((MMonGetVersion*)m);
+ handle_get_version(static_cast<MMonGetVersion*>(m));
break;
case MSG_MON_COMMAND:
- handle_command((MMonCommand*)m);
+ handle_command(static_cast<MMonCommand*>(m));
break;
case CEPH_MSG_MON_SUBSCRIBE:
/* FIXME: check what's being subscribed, filter accordingly */
- handle_subscribe((MMonSubscribe*)m);
+ handle_subscribe(static_cast<MMonSubscribe*>(m));
break;
case MSG_MON_PROBE:
- handle_probe((MMonProbe*)m);
+ handle_probe(static_cast<MMonProbe*>(m));
break;
// Sync (i.e., the new slurp, but on steroids)
case MSG_MON_SYNC:
- handle_sync((MMonSync*)m);
+ handle_sync(static_cast<MMonSync*>(m));
break;
// OSDs
// paxos
case MSG_MON_PAXOS:
{
- MMonPaxos *pm = (MMonPaxos*)m;
+ MMonPaxos *pm = static_cast<MMonPaxos*>(m);
if (!src_is_mon &&
!s->caps.check_privileges(PAXOS_MONMAP, MON_CAP_X)) {
//can't send these!
break;
case MSG_FORWARD:
- handle_forward((MForward *)m);
+ handle_forward(static_cast<MForward *>(m));
break;
case MSG_TIMECHECK:
- handle_timecheck((MTimeCheck *)m);
+ handle_timecheck(static_cast<MTimeCheck *>(m));
break;
default:
bool reply = false;
- MonSession *s = (MonSession *)m->get_connection()->get_priv();
+ MonSession *s = static_cast<MonSession *>(m->get_connection()->get_priv());
if (!s) {
dout(10) << " no session, dropping" << dendl;
m->put();
{
dout(10) << "handle_get_version " << *m << dendl;
- MonSession *s = (MonSession *)m->get_connection()->get_priv();
+ MonSession *s = static_cast<MonSession *>(m->get_connection()->get_priv());
if (!s) {
dout(10) << " no session, dropping" << dendl;
m->put();
if (con->get_peer_type() == CEPH_ENTITY_TYPE_MON)
return false;
- MonSession *s = (MonSession *)con->get_priv();
+ MonSession *s = static_cast<MonSession *>(con->get_priv());
if (!s)
return false;