]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: constify functions needed to use dout from a const function
authorJosh Durgin <josh.durgin@dreamhost.com>
Wed, 15 Feb 2012 01:53:28 +0000 (17:53 -0800)
committerJosh Durgin <josh.durgin@dreamhost.com>
Sat, 18 Feb 2012 00:34:35 +0000 (16:34 -0800)
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/mon/Monitor.cc
src/mon/Monitor.h
src/mon/PGMonitor.cc

index d1532f31079560d21a2b90563b65b265c922e1a5..3cfc46ade0866413d7978ef4edf86bf4dc66d981 100644 (file)
@@ -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() << " ";
 }
index 6d0ed691c39dbb321a58afdc45c1a58598dde9eb..8147a8ccbb5caca36dfe304d4f8da4d93705b3b0 100644 (file)
@@ -145,7 +145,7 @@ public:
     default: return "???";
     }
   }
-  const char *get_state_name() {
+  const char *get_state_name() const {
     return get_state_name(state);
   }
 
index e2fb70621a4285a1b5a9befa3836a1dd754616c9..6016e9e8a4d44b34f2e9c024c93f8ad760541693 100644 (file)
@@ -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 << " ";