From: Josh Durgin Date: Wed, 15 Feb 2012 01:53:28 +0000 (-0800) Subject: mon: constify functions needed to use dout from a const function X-Git-Tag: v0.43~43^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c0ab63e7b3df511f79ccc8b1dec520d7836209eb;p=ceph.git mon: constify functions needed to use dout from a const function Signed-off-by: Josh Durgin --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index d1532f310795..3cfc46ade086 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -73,7 +73,7 @@ #define DOUT_SUBSYS mon #undef dout_prefix #define dout_prefix _prefix(_dout, this) -static ostream& _prefix(std::ostream *_dout, Monitor *mon) { +static ostream& _prefix(std::ostream *_dout, const Monitor *mon) { return *_dout << "mon." << mon->name << "@" << mon->rank << "(" << mon->get_state_name() << ") e" << mon->monmap->get_epoch() << " "; } diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index 6d0ed691c39d..8147a8ccbb5c 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -145,7 +145,7 @@ public: default: return "???"; } } - const char *get_state_name() { + const char *get_state_name() const { return get_state_name(state); } diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index e2fb70621a42..6016e9e8a4d4 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -44,7 +44,7 @@ #define DOUT_SUBSYS mon #undef dout_prefix #define dout_prefix _prefix(_dout, mon, pg_map) -static ostream& _prefix(std::ostream *_dout, Monitor *mon, PGMap& pg_map) { +static ostream& _prefix(std::ostream *_dout, const Monitor *mon, const PGMap& pg_map) { return *_dout << "mon." << mon->name << "@" << mon->rank << "(" << mon->get_state_name() << ").pg v" << pg_map.version << " ";