From: Sage Weil Date: Mon, 20 Feb 2017 19:17:19 +0000 (-0500) Subject: osd: constify handle_pg_query X-Git-Tag: v12.0.1~279^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db805f6f1cd431a16754d9237153e2654b87ab15;p=ceph.git osd: constify handle_pg_query Signed-off-by: Sage Weil --- diff --git a/src/messages/MOSDPGQuery.h b/src/messages/MOSDPGQuery.h index 2306d755a897..5ab5e70f9cf4 100644 --- a/src/messages/MOSDPGQuery.h +++ b/src/messages/MOSDPGQuery.h @@ -29,7 +29,7 @@ class MOSDPGQuery : public Message { version_t epoch; public: - version_t get_epoch() { return epoch; } + version_t get_epoch() const { return epoch; } map pg_list; MOSDPGQuery() : Message(MSG_OSD_PG_QUERY, diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index c2f2b22317c3..736bc48e15ba 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -8349,7 +8349,7 @@ void OSD::handle_pg_query(OpRequestRef op) { assert(osd_lock.is_locked()); - MOSDPGQuery *m = (MOSDPGQuery*)op->get_req(); + const MOSDPGQuery *m = static_cast(op->get_req()); assert(m->get_type() == MSG_OSD_PG_QUERY); if (!require_osd_peer(op->get_req())) @@ -8365,7 +8365,7 @@ void OSD::handle_pg_query(OpRequestRef op) map< int, vector > > notify_list; - for (map::iterator it = m->pg_list.begin(); + for (auto it = m->pg_list.begin(); it != m->pg_list.end(); ++it) { spg_t pgid = it->first;