]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: constify handle_pg_info
authorSage Weil <sage@redhat.com>
Mon, 20 Feb 2017 19:17:47 +0000 (14:17 -0500)
committerSage Weil <sage@redhat.com>
Mon, 20 Feb 2017 19:22:07 +0000 (14:22 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/messages/MOSDPGInfo.h
src/osd/OSD.cc

index b7fe6d04433dd824287d745833c29c7dfa56ac65..0a82317658b2dc18e5d87382bb19550cee2de396 100644 (file)
@@ -28,7 +28,7 @@ class MOSDPGInfo : public Message {
 public:
   vector<pair<pg_notify_t,pg_interval_map_t> > 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) {
index e660fb7da8642c3daac20a463a71bf41a9a6618e..9c2c50a8f5cebc098b3f9feb79675ebd41829849 100644 (file)
@@ -8156,7 +8156,7 @@ void OSD::handle_pg_log(OpRequestRef op)
 
 void OSD::handle_pg_info(OpRequestRef op)
 {
-  MOSDPGInfo *m = static_cast<MOSDPGInfo *>(op->get_req());
+  const MOSDPGInfo *m = static_cast<const MOSDPGInfo *>(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<pair<pg_notify_t,pg_interval_map_t> >::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) {