From: Danny Al-Gaaf Date: Tue, 14 May 2013 18:04:22 +0000 (+0200) Subject: src/mds/flock.cc: reduce scope of old_lock_to_end in two cases X-Git-Tag: v0.64~119^2~21 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eb808cff392f69de8daf256534962674810f4ef1;p=ceph.git src/mds/flock.cc: reduce scope of old_lock_to_end in two cases Signed-off-by: Danny Al-Gaaf --- diff --git a/src/mds/flock.cc b/src/mds/flock.cc index b28851778417..e83c5ee23a0c 100644 --- a/src/mds/flock.cc +++ b/src/mds/flock.cc @@ -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::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::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;