From: Sage Weil Date: Tue, 17 Feb 2015 00:41:04 +0000 (-0800) Subject: osd/PG: make lock() and unlock() const X-Git-Tag: suse_latest~39^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=44e270def2e550faa3ab2de8a756a50160718db3;p=ceph.git osd/PG: make lock() and unlock() const Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 8c55007b6aa8..731c89a6a284 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -236,7 +236,7 @@ void PG::lock_suspend_timeout(ThreadPool::TPHandle &handle) handle.reset_tp_timeout(); } -void PG::lock(bool no_lockdep) +void PG::lock(bool no_lockdep) const { _lock.Lock(no_lockdep); // if we have unrecorded dirty state with the lock dropped, there is a bug diff --git a/src/osd/PG.h b/src/osd/PG.h index a1202c6aca7b..870fdf22e263 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -233,7 +233,7 @@ protected: * put() should be called on destruction of some previously copied pointer. * put_unlock() when done with the current pointer (_most common_). */ - Mutex _lock; + mutable Mutex _lock; atomic_t ref; #ifdef PG_DEBUG_REFS @@ -248,8 +248,8 @@ public: void lock_suspend_timeout(ThreadPool::TPHandle &handle); - void lock(bool no_lockdep = false); - void unlock() { + void lock(bool no_lockdep = false) const; + void unlock() const { //generic_dout(0) << this << " " << info.pgid << " unlock" << dendl; assert(!dirty_info); assert(!dirty_big_info);