osd: constify handle_pg_notify

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-02-20 14:16:23 -05:00
parent 854eee20e8
commit c8c6267fae
2 changed files with 7 additions and 6 deletions

View File

@ -36,12 +36,14 @@ class MOSDPGNotify : public Message {
vector<pair<pg_notify_t,pg_interval_map_t> > pg_list; // pgid -> version
public:
version_t get_epoch() { return epoch; }
vector<pair<pg_notify_t,pg_interval_map_t> >& get_pg_list() { return pg_list; }
version_t get_epoch() const { return epoch; }
const vector<pair<pg_notify_t,pg_interval_map_t> >& get_pg_list() const {
return pg_list;
}
MOSDPGNotify()
: Message(MSG_OSD_PG_NOTIFY, HEAD_VERSION, COMPAT_VERSION) {
set_priority(CEPH_MSG_PRIO_HIGH);
set_priority(CEPH_MSG_PRIO_HIGH);
}
MOSDPGNotify(epoch_t e, vector<pair<pg_notify_t,pg_interval_map_t> >& l)
: Message(MSG_OSD_PG_NOTIFY, HEAD_VERSION, COMPAT_VERSION),

View File

@ -8090,7 +8090,7 @@ void OSD::do_infos(map<int,
*/
void OSD::handle_pg_notify(OpRequestRef op)
{
MOSDPGNotify *m = (MOSDPGNotify*)op->get_req();
const MOSDPGNotify *m = static_cast<const MOSDPGNotify*>(op->get_req());
assert(m->get_type() == MSG_OSD_PG_NOTIFY);
dout(7) << "handle_pg_notify from " << m->get_source() << dendl;
@ -8104,10 +8104,9 @@ void OSD::handle_pg_notify(OpRequestRef op)
op->mark_started();
for (vector<pair<pg_notify_t, pg_interval_map_t> >::iterator it = m->get_pg_list().begin();
for (auto it = m->get_pg_list().begin();
it != m->get_pg_list().end();
++it) {
if (it->first.info.pgid.preferred() >= 0) {
dout(20) << "ignoring localized pg " << it->first.info.pgid << dendl;
continue;