From: Sage Weil Date: Mon, 20 Feb 2017 19:17:01 +0000 (-0500) Subject: osd: constify handle_pg_remove X-Git-Tag: v12.0.1~279^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6d9857cbc5549fdf02c43f812706e7ccf17fbbd6;p=ceph.git osd: constify handle_pg_remove Signed-off-by: Sage Weil --- diff --git a/src/messages/MOSDPGRemove.h b/src/messages/MOSDPGRemove.h index ca021fd7edec..502bd74dcaf0 100644 --- a/src/messages/MOSDPGRemove.h +++ b/src/messages/MOSDPGRemove.h @@ -30,7 +30,7 @@ class MOSDPGRemove : public Message { public: vector pg_list; - epoch_t get_epoch() { return epoch; } + epoch_t get_epoch() const { return epoch; } MOSDPGRemove() : Message(MSG_OSD_PG_REMOVE, HEAD_VERSION, COMPAT_VERSION) {} diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index ca062dee8db8..c2f2b22317c3 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -8456,7 +8456,7 @@ void OSD::handle_pg_query(OpRequestRef op) void OSD::handle_pg_remove(OpRequestRef op) { - MOSDPGRemove *m = (MOSDPGRemove *)op->get_req(); + const MOSDPGRemove *m = static_cast(op->get_req()); assert(m->get_type() == MSG_OSD_PG_REMOVE); assert(osd_lock.is_locked()); @@ -8471,7 +8471,7 @@ void OSD::handle_pg_remove(OpRequestRef op) op->mark_started(); - for (vector::iterator it = m->pg_list.begin(); + for (auto it = m->pg_list.begin(); it != m->pg_list.end(); ++it) { spg_t pgid = *it;