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

index dcd7480199bdc585f04c808cb5867c9667039b93..5c92f590d0ee45d30985b1a28d6e3ebbb4f30921 100644 (file)
@@ -36,12 +36,14 @@ class MOSDPGNotify : public Message {
   vector<pair<pg_notify_t,pg_interval_map_t> > pg_list;   // pgid -> version
 
  public:
-  version_t get_epoch() { return epoch; }
-  vector<pair<pg_notify_t,pg_interval_map_t> >& get_pg_list() { return pg_list; }
+  version_t get_epoch() const { return epoch; }
+  const vector<pair<pg_notify_t,pg_interval_map_t> >& 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<pair<pg_notify_t,pg_interval_map_t> >& l)
     : Message(MSG_OSD_PG_NOTIFY, HEAD_VERSION, COMPAT_VERSION),
index 507a5f592b50bb711fd98c2939f1d3cf76b34a72..ca062dee8db8fd099563ef38af7cdfbe50191cc3 100644 (file)
@@ -8090,7 +8090,7 @@ void OSD::do_infos(map<int,
  */
 void OSD::handle_pg_notify(OpRequestRef op)
 {
-  MOSDPGNotify *m = (MOSDPGNotify*)op->get_req();
+  const MOSDPGNotify *m = static_cast<const MOSDPGNotify*>(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<pair<pg_notify_t, pg_interval_map_t> >::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;