From: Sage Weil Date: Mon, 20 Feb 2017 17:25:27 +0000 (-0500) Subject: osd: make message check helpers const X-Git-Tag: v12.0.1~279^2~18 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1b2b06318c61341c75de8a51888dfd6aba121b98;p=ceph.git osd: make message check helpers const Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index b7cc4b1ddcd6..507a5f592b50 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -7632,7 +7632,7 @@ bool OSD::require_mon_peer(const Message *m) return true; } -bool OSD::require_osd_peer(Message *m) +bool OSD::require_osd_peer(const Message *m) { if (!m->get_connection()->peer_is_osd()) { dout(0) << "require_osd_peer received from non-osd " @@ -7643,7 +7643,7 @@ bool OSD::require_osd_peer(Message *m) return true; } -bool OSD::require_self_aliveness(Message *m, epoch_t epoch) +bool OSD::require_self_aliveness(const Message *m, epoch_t epoch) { epoch_t up_epoch = service.get_up_epoch(); if (epoch < up_epoch) { @@ -7659,7 +7659,7 @@ bool OSD::require_self_aliveness(Message *m, epoch_t epoch) return true; } -bool OSD::require_same_peer_instance(Message *m, OSDMapRef& map, +bool OSD::require_same_peer_instance(const Message *m, OSDMapRef& map, bool is_fast_dispatch) { int from = m->get_source().num(); @@ -8932,7 +8932,7 @@ void OSD::handle_replica_op(OpRequestRef& op, OSDMapRef& osdmap) } } -bool OSD::op_is_discardable(MOSDOp *op) +bool OSD::op_is_discardable(const MOSDOp *op) { // drop client request if they are not connected and can't get the // reply anyway. diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 6d2de7ce6344..23ce54a96187 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -2231,18 +2231,18 @@ protected: OSDMapRef map); bool require_mon_peer(const Message *m); - bool require_osd_peer(Message *m); + bool require_osd_peer(const Message *m); /*** * Verifies that we were alive in the given epoch, and that * still are. */ - bool require_self_aliveness(Message *m, epoch_t alive_since); + bool require_self_aliveness(const Message *m, epoch_t alive_since); /** * Verifies that the OSD who sent the given op has the same * address as in the given map. * @pre op was sent by an OSD using the cluster messenger */ - bool require_same_peer_instance(Message *m, OSDMapRef& map, + bool require_same_peer_instance(const Message *m, OSDMapRef& map, bool is_fast_dispatch); bool require_same_or_newer_map(OpRequestRef& op, epoch_t e, @@ -2493,7 +2493,7 @@ public: void handle_signal(int signum); /// check if we can throw out op from a disconnected client - static bool op_is_discardable(MOSDOp *m); + static bool op_is_discardable(const MOSDOp *m); public: OSDService service;