summaryrefslogtreecommitdiffstats
path: root/lib/private/files/view.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/view.php')
-rw-r--r--lib/private/files/view.php41
1 files changed, 25 insertions, 16 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 6f8a6db9f99..55b8da165e1 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -43,7 +43,6 @@
namespace OC\Files;
use Icewind\Streams\CallbackWrapper;
-use OC\Files\Cache\Updater;
use OC\Files\Mount\MoveableMount;
use OC\Files\Storage\Storage;
use OC\User\User;
@@ -53,6 +52,7 @@ use OCP\Files\InvalidCharacterInPathException;
use OCP\Files\InvalidPathException;
use OCP\Files\NotFoundException;
use OCP\Files\ReservedWordException;
+use OCP\Files\Storage\ILockingStorage;
use OCP\IUser;
use OCP\Lock\ILockingProvider;
use OCP\Lock\LockedException;
@@ -1835,11 +1835,14 @@ class View {
$mount = $this->getMountForLock($absolutePath, $lockMountPoint);
if ($mount) {
try {
- $mount->getStorage()->acquireLock(
- $mount->getInternalPath($absolutePath),
- $type,
- $this->lockingProvider
- );
+ $storage = $mount->getStorage();
+ if ($storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) {
+ $storage->acquireLock(
+ $mount->getInternalPath($absolutePath),
+ $type,
+ $this->lockingProvider
+ );
+ }
} catch (\OCP\Lock\LockedException $e) {
// rethrow with the a human-readable path
throw new \OCP\Lock\LockedException(
@@ -1873,11 +1876,14 @@ class View {
$mount = $this->getMountForLock($absolutePath, $lockMountPoint);
if ($mount) {
try {
- $mount->getStorage()->changeLock(
- $mount->getInternalPath($absolutePath),
- $type,
- $this->lockingProvider
- );
+ $storage = $mount->getStorage();
+ if ($storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) {
+ $storage->changeLock(
+ $mount->getInternalPath($absolutePath),
+ $type,
+ $this->lockingProvider
+ );
+ }
} catch (\OCP\Lock\LockedException $e) {
// rethrow with the a human-readable path
throw new \OCP\Lock\LockedException(
@@ -1908,11 +1914,14 @@ class View {
$mount = $this->getMountForLock($absolutePath, $lockMountPoint);
if ($mount) {
- $mount->getStorage()->releaseLock(
- $mount->getInternalPath($absolutePath),
- $type,
- $this->lockingProvider
- );
+ $storage = $mount->getStorage();
+ if ($storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) {
+ $storage->releaseLock(
+ $mount->getInternalPath($absolutePath),
+ $type,
+ $this->lockingProvider
+ );
+ }
}
return true;