]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: make lock() and unlock() const
authorSage Weil <sage@redhat.com>
Tue, 17 Feb 2015 00:41:04 +0000 (16:41 -0800)
committerSage Weil <sage@redhat.com>
Tue, 17 Feb 2015 01:30:55 +0000 (17:30 -0800)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc
src/osd/PG.h

index 8c55007b6aa8ce610b05e6b01c0411cbbe9b09db..731c89a6a284445566dc9918a35281f8084f8743 100644 (file)
@@ -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
index a1202c6aca7b5f51fd3c3344075b4c9610ccef60..870fdf22e2632306a593eb18d22725cc8b4d8a52 100644 (file)
@@ -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);