From b2d365734a692c6e09a07d0190fdabf64f3a295a Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 25 Aug 2016 15:49:18 +0200 Subject: [PATCH] cache root id in mountpoint --- lib/private/Files/Mount/MountPoint.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/private/Files/Mount/MountPoint.php b/lib/private/Files/Mount/MountPoint.php index 4aef340149..42b79596c9 100644 --- a/lib/private/Files/Mount/MountPoint.php +++ b/lib/private/Files/Mount/MountPoint.php @@ -41,6 +41,7 @@ class MountPoint implements IMountPoint { protected $storage = null; protected $class; protected $storageId; + protected $rootId = null; /** * Configuration options for the storage backend @@ -264,7 +265,10 @@ class MountPoint implements IMountPoint { * @return int */ public function getStorageRootId() { - return (int)$this->getStorage()->getCache()->getId(''); + if (is_null($this->rootId)) { + $this->rootId = (int)$this->getStorage()->getCache()->getId(''); + } + return $this->rootId; } public function getMountId() {