From: Kefu Chai Date: Tue, 14 Feb 2017 02:58:17 +0000 (+0800) Subject: mon/MonClient: mark monc_lock a mutable X-Git-Tag: v12.0.1~412^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8729e1eb9cba7d23690ac9c634eadd9fc172a8d3;p=ceph-ci.git mon/MonClient: mark monc_lock a mutable so we can label the getters of MonClient with the `const` specifier. Signed-off-by: Kefu Chai --- diff --git a/src/mon/MonClient.h b/src/mon/MonClient.h index 2c029afab39..7e1d9da9b82 100644 --- a/src/mon/MonClient.h +++ b/src/mon/MonClient.h @@ -119,7 +119,7 @@ private: entity_addr_t my_addr; - Mutex monc_lock; + mutable Mutex monc_lock; SafeTimer timer; Finisher finisher; @@ -340,23 +340,23 @@ public: return my_addr; } - const uuid_d& get_fsid() { + const uuid_d& get_fsid() const { return monmap.fsid; } - entity_addr_t get_mon_addr(unsigned i) { + entity_addr_t get_mon_addr(unsigned i) const { Mutex::Locker l(monc_lock); if (i < monmap.size()) return monmap.get_addr(i); return entity_addr_t(); } - entity_inst_t get_mon_inst(unsigned i) { + entity_inst_t get_mon_inst(unsigned i) const { Mutex::Locker l(monc_lock); if (i < monmap.size()) return monmap.get_inst(i); return entity_inst_t(); } - int get_num_mon() { + int get_num_mon() const { Mutex::Locker l(monc_lock); return monmap.size(); }