From: Sage Weil Date: Mon, 20 Feb 2017 19:17:47 +0000 (-0500) Subject: osd: constify handle_pg_info X-Git-Tag: v12.0.1~279^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1f7f4de51caed86ab855b1d4f5ccc42deb94805a;p=ceph.git osd: constify handle_pg_info Signed-off-by: Sage Weil --- diff --git a/src/messages/MOSDPGInfo.h b/src/messages/MOSDPGInfo.h index b7fe6d04433d..0a82317658b2 100644 --- a/src/messages/MOSDPGInfo.h +++ b/src/messages/MOSDPGInfo.h @@ -28,7 +28,7 @@ class MOSDPGInfo : public Message { public: vector > pg_list; - epoch_t get_epoch() { return epoch; } + epoch_t get_epoch() const { return epoch; } MOSDPGInfo() : Message(MSG_OSD_PG_INFO, HEAD_VERSION, COMPAT_VERSION) { diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index e660fb7da864..9c2c50a8f5ce 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -8156,7 +8156,7 @@ void OSD::handle_pg_log(OpRequestRef op) void OSD::handle_pg_info(OpRequestRef op) { - MOSDPGInfo *m = static_cast(op->get_req()); + const MOSDPGInfo *m = static_cast(op->get_req()); assert(m->get_type() == MSG_OSD_PG_INFO); dout(7) << "handle_pg_info " << *m << " from " << m->get_source() << dendl; @@ -8169,7 +8169,7 @@ void OSD::handle_pg_info(OpRequestRef op) op->mark_started(); - for (vector >::iterator p = m->pg_list.begin(); + for (auto p = m->pg_list.begin(); p != m->pg_list.end(); ++p) { if (p->first.info.pgid.preferred() >= 0) {