]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/mds/flock.cc: reduce scope of old_lock_to_end in two cases
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 14 May 2013 18:04:22 +0000 (20:04 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 16 May 2013 12:15:47 +0000 (14:15 +0200)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/mds/flock.cc

index b28851778417d90f38fdd410d8b2b8f34f6bb1d5..e83c5ee23a0ce5c4b6aa5364ba592f93b84ccae4 100644 (file)
@@ -131,7 +131,6 @@ void ceph_lock_state_t::remove_lock(ceph_filelock removal_lock,
   } else dout(15) << "attempt to remove lock at " << removal_lock.start
                  << " but no locks there!" << dendl;
   bool remove_to_end = (0 == removal_lock.length);
-  bool old_lock_to_end;
   uint64_t removal_start = removal_lock.start;
   uint64_t removal_end = removal_start + removal_lock.length - 1;
   uint64_t old_lock_end;
@@ -146,7 +145,7 @@ void ceph_lock_state_t::remove_lock(ceph_filelock removal_lock,
        ++iter) {
     dout(15) << "self overlapping lock " << (*iter)->second << dendl;
     old_lock = &(*iter)->second;
-    old_lock_to_end = (0 == old_lock->length);
+    bool old_lock_to_end = (0 == old_lock->length);
     old_lock_end = old_lock->start + old_lock->length - 1;
     old_lock_client = old_lock->client;
     if (remove_to_end) {
@@ -213,7 +212,6 @@ void ceph_lock_state_t::adjust_locks(list<multimap<uint64_t, ceph_filelock>::ite
 {
   dout(15) << "adjust_locks" << dendl;
   bool new_lock_to_end = (0 == new_lock.length);
-  bool old_lock_to_end;
   uint64_t new_lock_start = new_lock.start;
   uint64_t new_lock_end = new_lock.start + new_lock.length - 1;
   uint64_t old_lock_start, old_lock_end;
@@ -225,7 +223,7 @@ void ceph_lock_state_t::adjust_locks(list<multimap<uint64_t, ceph_filelock>::ite
        ++iter) {
     old_lock = &(*iter)->second;
     dout(15) << "adjusting lock: " << *old_lock << dendl;
-    old_lock_to_end = (0 == old_lock->length);
+    bool old_lock_to_end = (0 == old_lock->length);
     old_lock_start = old_lock->start;
     old_lock_end = old_lock->start + old_lock->length - 1;
     new_lock_start = new_lock.start;