Skip to content

Commit fcdb28e

Browse files
committed
feat: add IPartialMountProvider to support authoritative mounts
IMountProviders implementing this interface will be able to take advantage of authoritative mounts. The function `getMountsFromMountPoints` will receive the path that the provider is asked to set-up and an array of IMountProviderArgs providing information regarding the stored mount points and the file cache data for the related root. The mount provider should verify the validity of the mounts and return IMountPoints related to them. Signed-off-by: Salvatore Martire <[email protected]>
1 parent 9b519b4 commit fcdb28e

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed

lib/composer/composer/autoload_classmap.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,9 @@
420420
'OCP\\Files\\Config\\ICachedMountInfo' => $baseDir . '/lib/public/Files/Config/ICachedMountInfo.php',
421421
'OCP\\Files\\Config\\IHomeMountProvider' => $baseDir . '/lib/public/Files/Config/IHomeMountProvider.php',
422422
'OCP\\Files\\Config\\IMountProvider' => $baseDir . '/lib/public/Files/Config/IMountProvider.php',
423+
'OCP\\Files\\Config\\IMountProviderArgs' => $baseDir . '/lib/public/Files/Config/IMountProviderArgs.php',
423424
'OCP\\Files\\Config\\IMountProviderCollection' => $baseDir . '/lib/public/Files/Config/IMountProviderCollection.php',
425+
'OCP\\Files\\Config\\IPartialMountProvider' => $baseDir . '/lib/public/Files/Config/IPartialMountProvider.php',
424426
'OCP\\Files\\Config\\IRootMountProvider' => $baseDir . '/lib/public/Files/Config/IRootMountProvider.php',
425427
'OCP\\Files\\Config\\IUserMountCache' => $baseDir . '/lib/public/Files/Config/IUserMountCache.php',
426428
'OCP\\Files\\ConnectionLostException' => $baseDir . '/lib/public/Files/ConnectionLostException.php',

lib/composer/composer/autoload_static.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,9 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
461461
'OCP\\Files\\Config\\ICachedMountInfo' => __DIR__ . '/../../..' . '/lib/public/Files/Config/ICachedMountInfo.php',
462462
'OCP\\Files\\Config\\IHomeMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IHomeMountProvider.php',
463463
'OCP\\Files\\Config\\IMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProvider.php',
464+
'OCP\\Files\\Config\\IMountProviderArgs' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProviderArgs.php',
464465
'OCP\\Files\\Config\\IMountProviderCollection' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProviderCollection.php',
466+
'OCP\\Files\\Config\\IPartialMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IPartialMountProvider.php',
465467
'OCP\\Files\\Config\\IRootMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IRootMountProvider.php',
466468
'OCP\\Files\\Config\\IUserMountCache' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IUserMountCache.php',
467469
'OCP\\Files\\ConnectionLostException' => __DIR__ . '/../../..' . '/lib/public/Files/ConnectionLostException.php',
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
7+
* SPDX-License-Identifier: AGPL-3.0-or-later
8+
*/
9+
namespace OCP\Files\Config;
10+
11+
use OCP\Files\Cache\ICacheEntry;
12+
13+
/**
14+
* Data-class containing information related to a mount and its root.
15+
*
16+
* @since 33.0.0
17+
*/
18+
class IMountProviderArgs {
19+
public function __construct(
20+
public ICachedMountInfo $mountInfo,
21+
public ICacheEntry $cacheEntry,
22+
) {
23+
}
24+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
7+
* SPDX-License-Identifier: AGPL-3.0-or-later
8+
*/
9+
namespace OCP\Files\Config;
10+
11+
use OCP\Files\Mount\IMountPoint;
12+
use OCP\Files\Storage\IStorageFactory;
13+
14+
/**
15+
* This interface marks mount providers that can provide IMountPoints related to
16+
* a path based on the provided mount and root metadata.
17+
*
18+
* @since 33.0.0
19+
*/
20+
interface IPartialMountProvider extends IMountProvider {
21+
22+
/**
23+
* Called during the Filesystem setup of a specific path.
24+
*
25+
* The provided arguments give information about the path being set up,
26+
* as well as information about mount points known to be provided by the
27+
* mount provider and contained in the path or in its sub-paths.
28+
*
29+
* Implementations should verify the IMountProviderArgs and return the
30+
* corresponding IMountPoint instances.
31+
*
32+
* @param string $path path for which the mounts are set up
33+
* @param IMountProviderArgs[] $mountProviderArgs
34+
* @param IStorageFactory $loader
35+
* @return array<string, IMountPoint> IMountPoint instances, indexed by
36+
* mount-point
37+
*/
38+
public function getMountsForPath(
39+
string $path,
40+
array $mountProviderArgs,
41+
IStorageFactory $loader,
42+
): array;
43+
}

0 commit comments

Comments
 (0)