]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: cleanup-let: use is_leased() for lease revocation checks
authorSage Weil <sage.weil@dreamhost.com>
Fri, 22 Jul 2011 15:51:04 +0000 (08:51 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 22 Jul 2011 15:51:04 +0000 (08:51 -0700)
And add const-ness.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/mds/Locker.cc
src/mds/SimpleLock.h

index 7a61d157996a5247f84b14819727bad5b80f9a92..642caa83b602562f39c007e06464c6c37a6571b5 100644 (file)
@@ -3345,7 +3345,7 @@ void Locker::simple_lock(SimpleLock *lock, bool *need_issue)
   }
 
   int gather = 0;
-  if (lock->get_num_client_lease()) {
+  if (lock->is_leased()) {
     gather++;
     revoke_client_leases(lock);
   }
@@ -4013,7 +4013,7 @@ void Locker::scatter_mix(ScatterLock *lock, bool *need_issue)
        gather++;
       }
     }
-    if (lock->get_num_client_lease()) {
+    if (lock->is_leased()) {
       revoke_client_leases(lock);
       gather++;
     }
@@ -4081,7 +4081,7 @@ void Locker::file_excl(ScatterLock *lock, bool *need_issue)
     lock->init_gather();
     gather++;
   }
-  if (lock->get_num_client_lease()) {
+  if (lock->is_leased()) {
     revoke_client_leases(lock);
     gather++;
   }
index bfed8f3b4623e4b459d5098f74f2cf6d1b901646..75cf370f8c5f8aacd90ae6f2994834f5feaf8f9b 100644 (file)
@@ -530,8 +530,10 @@ public:
       try_clear_more();
     }
   }
-  bool is_leased() const { return num_client_lease > 0; }
-  int get_num_client_lease() {
+  bool is_leased() const {
+    return num_client_lease > 0;
+  }
+  int get_num_client_lease() const {
     return num_client_lease;
   }