summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-05-04 12:51:41 +0200
committerRobin Appelman <robin@icewind.nl>2018-05-04 15:06:39 +0200
commita6ea5eb1b543c471f893e541d9c642923729b901 (patch)
treeacfd37318d8ae90202d5e7445126c02fc9eac2b7 /lib
parent642ebea4902c57ea2e536f9389602f3061572af1 (diff)
downloadnextcloud-server-a6ea5eb1b543c471f893e541d9c642923729b901.tar.gz
nextcloud-server-a6ea5eb1b543c471f893e541d9c642923729b901.zip
remove unneeded locks in getCacheEntry
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/View.php4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index 592d4b717ce..73219635e89 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1318,15 +1318,13 @@ class View {
try {
// if the file is not in the cache or needs to be updated, trigger the scanner and reload the data
if (!$data || $data['size'] === -1) {
- $this->lockFile($relativePath, ILockingProvider::LOCK_SHARED);
if (!$storage->file_exists($internalPath)) {
- $this->unlockFile($relativePath, ILockingProvider::LOCK_SHARED);
return false;
}
+ // don't need to get a lock here since the scanner does it's own locking
$scanner = $storage->getScanner($internalPath);
$scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
$data = $cache->get($internalPath);
- $this->unlockFile($relativePath, ILockingProvider::LOCK_SHARED);
} else if (!Cache\Scanner::isPartialFile($internalPath) && $watcher->needsUpdate($internalPath, $data)) {
$this->lockFile($relativePath, ILockingProvider::LOCK_SHARED);
$watcher->update($internalPath, $data);