From 1f7f4de51caed86ab855b1d4f5ccc42deb94805a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 20 Feb 2017 14:17:47 -0500 Subject: [PATCH] osd: constify handle_pg_info Signed-off-by: Sage Weil --- src/messages/MOSDPGInfo.h | 2 +- src/osd/OSD.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/messages/MOSDPGInfo.h b/src/messages/MOSDPGInfo.h index b7fe6d04433..0a82317658b 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 e660fb7da86..9c2c50a8f5c 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) { -- 2.47.3