diff options
author | Robin Appelman <robin@icewind.nl> | 2020-09-15 17:01:33 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2020-09-16 13:49:07 +0200 |
commit | cfde74442c67b9a6e639536536c18e4c6d4f7a0e (patch) | |
tree | c2febb15ec88d7e3480cceac088c4266ba7b34e2 /apps/files_sharing | |
parent | 244fd6ae49dd1712d07bf64d1d27b8cfafe441ad (diff) | |
download | nextcloud-server-cfde74442c67b9a6e639536536c18e4c6d4f7a0e.tar.gz nextcloud-server-cfde74442c67b9a6e639536536c18e4c6d4f7a0e.zip |
optimize View::getPath if we already know the storage id
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/SharedStorage.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index 43896679a31..7625c0bba44 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -33,7 +33,6 @@ namespace OCA\Files_Sharing; use OC\Files\Cache\FailedCache; -use OC\Files\Cache\LazyWatcher; use OC\Files\Cache\NullWatcher; use OC\Files\Filesystem; use OC\Files\Storage\FailedStorage; @@ -127,11 +126,12 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto $this->initialized = true; try { Filesystem::initMountPoints($this->superShare->getShareOwner()); - $sourcePath = $this->ownerView->getPath($this->superShare->getNodeId()); + $storageId = $this->superShare->getNodeCacheEntry() ? $this->superShare->getNodeCacheEntry()->getStorageId() : null; + $sourcePath = $this->ownerView->getPath($this->superShare->getNodeId(), $storageId); [$this->nonMaskedStorage, $this->rootPath] = $this->ownerView->resolvePath($sourcePath); $this->storage = new PermissionsMask([ 'storage' => $this->nonMaskedStorage, - 'mask' => $this->superShare->getPermissions() + 'mask' => $this->superShare->getPermissions(), ]); } catch (NotFoundException $e) { // original file not accessible or deleted, set FailedStorage @@ -379,7 +379,7 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto if (!$storage) { $storage = $this; } - $sourceRoot = $this->getSourceRootInfo(); + $sourceRoot = $this->getSourceRootInfo(); if ($this->storage instanceof FailedStorage) { return new FailedCache(); } @@ -467,7 +467,7 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto // shares do not participate in availability logic return [ 'available' => true, - 'last_checked' => 0 + 'last_checked' => 0, ]; } |