Use md5 for lock key
This commit is contained in:
parent
5edf294ce5
commit
0775e9c1ca
|
@ -630,7 +630,7 @@ abstract class Common implements Storage {
|
|||
* @throws \OCP\Lock\LockedException
|
||||
*/
|
||||
public function acquireLock($path, $type, ILockingProvider $provider) {
|
||||
$provider->acquireLock($this->getId() . '::' . $path, $type);
|
||||
$provider->acquireLock(md5($this->getId() . '::' . $path), $type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -639,6 +639,6 @@ abstract class Common implements Storage {
|
|||
* @param \OCP\Lock\ILockingProvider $provider
|
||||
*/
|
||||
public function releaseLock($path, $type, ILockingProvider $provider) {
|
||||
$provider->releaseLock($this->getId() . '::' . $path, $type);
|
||||
$provider->releaseLock(md5($this->getId() . '::' . $path), $type);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1639,14 +1639,26 @@ class View {
|
|||
private function lockPath($path, $type) {
|
||||
$mount = $this->getMount($path);
|
||||
if ($mount) {
|
||||
$mount->getStorage()->acquireLock($mount->getInternalPath($this->getAbsolutePath($path)), $type, $this->lockingProvider);
|
||||
$mount->getStorage()->acquireLock(
|
||||
$mount->getInternalPath(
|
||||
$this->getAbsolutePath($path)
|
||||
),
|
||||
$type,
|
||||
$this->lockingProvider
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private function unlockPath($path, $type) {
|
||||
$mount = $this->getMount($path);
|
||||
if ($mount) {
|
||||
$mount->getStorage()->releaseLock($mount->getInternalPath($this->getAbsolutePath($path)), $type, $this->lockingProvider);
|
||||
$mount->getStorage()->releaseLock(
|
||||
$mount->getInternalPath(
|
||||
$this->getAbsolutePath($path)
|
||||
),
|
||||
$type,
|
||||
$this->lockingProvider
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue