From 58b5193ef53bdfa8b99471176ee6b4d6479376cb Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 1 Feb 2013 10:55:07 -0800 Subject: [PATCH] [LockManager] Renamed getBucketFromKey() -> getBucketFromPath(). Change-Id: I825dcd255f0b85f81bf925abf46bc46b1fe42e9f --- includes/filebackend/lockmanager/QuorumLockManager.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/filebackend/lockmanager/QuorumLockManager.php b/includes/filebackend/lockmanager/QuorumLockManager.php index 4198764e2d..76a3ad6e28 100644 --- a/includes/filebackend/lockmanager/QuorumLockManager.php +++ b/includes/filebackend/lockmanager/QuorumLockManager.php @@ -49,7 +49,7 @@ abstract class QuorumLockManager extends LockManager { } elseif ( isset( $this->locksHeld[$path][self::LOCK_EX] ) ) { $this->locksHeld[$path][$type] = 1; } else { - $bucket = $this->getBucketFromKey( $path ); + $bucket = $this->getBucketFromPath( $path ); $pathsToLock[$bucket][] = $path; } } @@ -92,7 +92,7 @@ abstract class QuorumLockManager extends LockManager { // Reference count the locks held and release locks when zero if ( $this->locksHeld[$path][$type] <= 0 ) { unset( $this->locksHeld[$path][$type] ); - $bucket = $this->getBucketFromKey( $path ); + $bucket = $this->getBucketFromPath( $path ); $pathsToUnlock[$bucket][] = $path; } if ( !count( $this->locksHeld[$path] ) ) { @@ -186,7 +186,7 @@ abstract class QuorumLockManager extends LockManager { * @param $path string * @return integer */ - protected function getBucketFromKey( $path ) { + protected function getBucketFromPath( $path ) { $prefix = substr( sha1( $path ), 0, 2 ); // first 2 hex chars (8 bits) return (int)base_convert( $prefix, 16, 10 ) % count( $this->srvsByBucket ); } -- 2.20.1