From: Joao Eduardo Luis Date: Wed, 17 Jun 2015 11:59:34 +0000 (+0100) Subject: mon: services: use mon->send_reply(op,...) instead X-Git-Tag: v9.1.0~535^2~22 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2179b4d34caa495f0b96decc8afb9319deb46cc4;p=ceph.git mon: services: use mon->send_reply(op,...) instead We are replying to operations, not messages, so use the appropriate function to do so (and mark events). Signed-off-by: Joao Eduardo Luis --- diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index a82dbb71f0cb..fb6c753787ff 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -509,7 +509,7 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable) reply: reply = new MAuthReply(proto, &response_bl, ret, s->global_id); - mon->send_reply(m, reply); + mon->send_reply(op, reply); done: s->put(); return true; diff --git a/src/mon/LogMonitor.cc b/src/mon/LogMonitor.cc index b7e338e49995..2d2c48d91d58 100644 --- a/src/mon/LogMonitor.cc +++ b/src/mon/LogMonitor.cc @@ -356,7 +356,7 @@ void LogMonitor::_updated_log(MonOpRequestRef op) { MLog *m = static_cast(op->get_req()); dout(7) << "_updated_log for " << m->get_orig_source_inst() << dendl; - mon->send_reply(m, new MLogAck(m->fsid, m->entries.rbegin()->seq)); + mon->send_reply(op, new MLogAck(m->fsid, m->entries.rbegin()->seq)); } bool LogMonitor::should_propose(double& delay) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 3de78d67a2e1..68bd912a47fb 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -296,7 +296,7 @@ bool MDSMonitor::preprocess_beacon(MonOpRequestRef op) if (pending_mdsmap.is_dne_gid(gid)) { if (state != MDSMap::STATE_BOOT) { dout(7) << "mds_beacon " << *m << " is not in mdsmap" << dendl; - mon->send_reply(m, new MMDSMap(mon->monmap->fsid, &mdsmap)); + mon->send_reply(op, new MMDSMap(mon->monmap->fsid, &mdsmap)); return true; } else { return false; // not booted yet. @@ -361,7 +361,7 @@ bool MDSMonitor::preprocess_beacon(MonOpRequestRef op) reply: // note time and reply _note_beacon(m); - mon->send_reply(m, + mon->send_reply(op, new MMDSBeacon(mon->monmap->fsid, m->get_global_id(), m->get_name(), mdsmap.get_epoch(), state, seq)); return true; @@ -585,7 +585,7 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op) pending_mdsmap.mds_info.erase(gid); // Respond to MDS, so that it knows it can continue to shut down - mon->send_reply(m, new MMDSBeacon(mon->monmap->fsid, m->get_global_id(), + mon->send_reply(op, new MMDSBeacon(mon->monmap->fsid, m->get_global_id(), m->get_name(), mdsmap.get_epoch(), state, seq)); } else if (state == MDSMap::STATE_DNE) { if (!mon->osdmon()->is_writeable()) { @@ -600,7 +600,7 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op) request_proposal(mon->osdmon()); // Respond to MDS, so that it knows it can continue to shut down - mon->send_reply(m, new MMDSBeacon(mon->monmap->fsid, m->get_global_id(), + mon->send_reply(op, new MMDSBeacon(mon->monmap->fsid, m->get_global_id(), m->get_name(), mdsmap.get_epoch(), state, seq)); } else { info.state = state; @@ -644,9 +644,9 @@ void MDSMonitor::_updated(MonOpRequestRef op) if (m->get_state() == MDSMap::STATE_STOPPED) { // send the map manually (they're out of the map, so they won't get it automatic) - mon->send_reply(m, new MMDSMap(mon->monmap->fsid, &mdsmap)); + mon->send_reply(op, new MMDSMap(mon->monmap->fsid, &mdsmap)); } else { - mon->send_reply(m, new MMDSBeacon(mon->monmap->fsid, + mon->send_reply(op, new MMDSBeacon(mon->monmap->fsid, m->get_global_id(), m->get_name(), mdsmap.get_epoch(), diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 5b4740f39f52..3b43cc8eb23d 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1371,7 +1371,7 @@ bool OSDMonitor::preprocess_get_osdmap(MonOpRequestRef op) } reply->oldest_map = get_first_committed(); reply->newest_map = osdmap.get_epoch(); - mon->send_reply(m, reply); + mon->send_reply(op, reply); return true; } @@ -1470,7 +1470,7 @@ public: void _finish(int) { MOSDMarkMeDown *m = static_cast(op->get_req()); osdmon->mon->send_reply( - m, + op, new MOSDMarkMeDown( m->fsid, m->get_target(), @@ -7519,5 +7519,5 @@ void OSDMonitor::_pool_op_reply(MonOpRequestRef op, dout(20) << "_pool_op_reply " << ret << dendl; MPoolOpReply *reply = new MPoolOpReply(m->fsid, m->get_tid(), ret, epoch, get_last_committed(), blp); - mon->send_reply(m, reply); + mon->send_reply(op, reply); } diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index fe464bf1b453..528ad6d02475 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -647,7 +647,7 @@ void PGMonitor::handle_statfs(MonOpRequestRef op) reply->h.st.num_objects = pg_map.pg_sum.stats.sum.num_objects; // reply - mon->send_reply(statfs, reply); + mon->send_reply(op, reply); } bool PGMonitor::preprocess_getpoolstats(MonOpRequestRef op) @@ -682,7 +682,7 @@ bool PGMonitor::preprocess_getpoolstats(MonOpRequestRef op) reply->pool_stats[*p] = pg_map.pg_pool_sum[poolid]; } - mon->send_reply(m, reply); + mon->send_reply(op, reply); out: return true; @@ -769,7 +769,7 @@ bool PGMonitor::prepare_pg_stats(MonOpRequestRef op) ++p) { ack->pg_stat[p->first] = make_pair(p->second.reported_seq, p->second.reported_epoch); } - mon->send_reply(stats, ack); + mon->send_reply(op, ack); return false; } @@ -838,10 +838,10 @@ bool PGMonitor::prepare_pg_stats(MonOpRequestRef op) void PGMonitor::_updated_stats(MonOpRequestRef op, MonOpRequestRef ack_op) { - MPGStats *req = static_cast(op->get_req()); MPGStats *ack = static_cast(ack_op->get_req()); - dout(7) << "_updated_stats for " << req->get_orig_source_inst() << dendl; - mon->send_reply(req, ack); + dout(7) << "_updated_stats for " + << op->get_req()->get_orig_source_inst() << dendl; + mon->send_reply(op, ack); }