diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2024-03-07 14:38:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-07 14:38:02 +0100 |
commit | 951c330d3948de9933dee535d7933af164e445f3 (patch) | |
tree | 5f108b170307fd92efd0d75a2a9fc1d15bb1bf13 /lib | |
parent | e17424fa11e25828cce3756e9c076f08f9c45e01 (diff) | |
download | nextcloud-server-951c330d3948de9933dee535d7933af164e445f3.tar.gz nextcloud-server-951c330d3948de9933dee535d7933af164e445f3.zip |
Revert "don't perform an explicit setup when using the file cache"
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Cache/File.php | 2 | ||||
-rw-r--r-- | lib/private/Files/Config/UserMountCache.php | 2 | ||||
-rw-r--r-- | lib/private/Files/ObjectStore/ObjectStoreStorage.php | 8 | ||||
-rw-r--r-- | lib/private/Files/SetupManager.php | 15 |
4 files changed, 5 insertions, 22 deletions
diff --git a/lib/private/Cache/File.php b/lib/private/Cache/File.php index ecff643ed63..74e795cc377 100644 --- a/lib/private/Cache/File.php +++ b/lib/private/Cache/File.php @@ -29,6 +29,7 @@ */ namespace OC\Cache; +use OC\Files\Filesystem; use OC\Files\View; use OCP\ICache; use OCP\Security\ISecureRandom; @@ -52,6 +53,7 @@ class File implements ICache { if (\OC::$server->getUserSession()->isLoggedIn()) { $rootView = new View(); $user = \OC::$server->getUserSession()->getUser(); + Filesystem::initMountPoints($user->getUID()); if (!$rootView->file_exists('/' . $user->getUID() . '/cache')) { $rootView->mkdir('/' . $user->getUID() . '/cache'); } diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 6ee40ae4693..8275eee7b9f 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -95,7 +95,7 @@ class UserMountCache implements IUserMountCache { $cachedMounts = $this->getMountsForUser($user); if (is_array($mountProviderClasses)) { - $cachedMounts = array_filter($cachedMounts, function (ICachedMountInfo $mountInfo) use ($mountProviderClasses, $newMounts): bool { + $cachedMounts = array_filter($cachedMounts, function (ICachedMountInfo $mountInfo) use ($mountProviderClasses, $newMounts) { // for existing mounts that didn't have a mount provider set // we still want the ones that map to new mounts if ($mountInfo->getMountProvider() === '' && isset($newMounts[$mountInfo->getKey()])) { diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 3ef13f0ab01..7eb284fc774 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -82,14 +82,6 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil if (isset($params['validateWrites'])) { $this->validateWrites = (bool)$params['validateWrites']; } - - // home storage is setup in the SetupManager - if (!$this instanceof HomeObjectStoreStorage) { - //initialize cache with root directory in cache - if (!$this->is_dir('/')) { - $this->mkdir('/'); - } - } $this->handleCopiesAsOwned = (bool)($params['handleCopiesAsOwned'] ?? false); $this->logger = \OCP\Server::get(LoggerInterface::class); diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php index accb071a814..93b7dc37b6b 100644 --- a/lib/private/Files/SetupManager.php +++ b/lib/private/Files/SetupManager.php @@ -257,21 +257,10 @@ class SetupManager { if ($homeMount->getStorageRootId() === -1) { $this->eventLogger->start('fs:setup:user:home:scan', 'Scan home filesystem for user'); - $homeStorage = $homeMount->getStorage(); - $homeStorage->mkdir(''); - $homeStorage->mkdir('files'); - $homeStorage->getScanner()->scan(''); + $homeMount->getStorage()->mkdir(''); + $homeMount->getStorage()->getScanner()->scan(''); $this->eventLogger->end('fs:setup:user:home:scan'); } - - $provider = $homeMount->getMountProvider(); - $this->userMountCache->registerMounts($user, [$homeMount], [$provider]); - if (!isset($this->setupUserMountProviders[$user->getUID()])) { - $this->setupUserMountProviders[$user->getUID()] = []; - } - if (!in_array($provider, $this->setupUserMountProviders[$user->getUID()])) { - $this->setupUserMountProviders[$user->getUID()][] = $provider; - } $this->eventLogger->end('fs:setup:user:home'); } else { $this->mountManager->addMount(new MountPoint( |