From: Sage Weil Date: Mon, 20 Feb 2017 19:16:23 +0000 (-0500) Subject: osd: constify handle_pg_notify X-Git-Tag: v12.0.1~279^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c8c6267faef02897086e97d787603b03db1b2c26;p=ceph.git osd: constify handle_pg_notify Signed-off-by: Sage Weil --- diff --git a/src/messages/MOSDPGNotify.h b/src/messages/MOSDPGNotify.h index dcd7480199bd..5c92f590d0ee 100644 --- a/src/messages/MOSDPGNotify.h +++ b/src/messages/MOSDPGNotify.h @@ -36,12 +36,14 @@ class MOSDPGNotify : public Message { vector > pg_list; // pgid -> version public: - version_t get_epoch() { return epoch; } - vector >& get_pg_list() { return pg_list; } + version_t get_epoch() const { return epoch; } + const vector >& 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 >& l) : Message(MSG_OSD_PG_NOTIFY, HEAD_VERSION, COMPAT_VERSION), diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 507a5f592b50..ca062dee8db8 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -8090,7 +8090,7 @@ void OSD::do_infos(mapget_req(); + const MOSDPGNotify *m = static_cast(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 >::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;