Skip to content

Commit

Permalink
dont re-query fileinfo when getting dav quota
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Mar 28, 2022
1 parent c407bb9 commit 1e5105a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions apps/dav/lib/Connector/Sabre/Directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,7 @@ public function getQuotaInfo() {
return $this->quotaInfo;
}
try {
$info = $this->fileView->getFileInfo($this->path, false);
$storageInfo = \OC_Helper::getStorageInfo($this->info->getPath(), $info);
$storageInfo = \OC_Helper::getStorageInfo($this->info->getPath(), $this->info, false);
if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
$free = \OCP\Files\FileInfo::SPACE_UNLIMITED;
} else {
Expand Down
4 changes: 2 additions & 2 deletions lib/private/legacy/OC_Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public static function findBinaryPath($program) {
* @return array
* @throws \OCP\Files\NotFoundException
*/
public static function getStorageInfo($path, $rootInfo = null) {
public static function getStorageInfo($path, $rootInfo = null, $includeMountPoints = true) {
// return storage info without adding mount points
$includeExtStorage = \OC::$server->getSystemConfig()->getValue('quota_include_external_storage', false);

Expand All @@ -495,7 +495,7 @@ public static function getStorageInfo($path, $rootInfo = null) {
if (!$rootInfo instanceof \OCP\Files\FileInfo) {
throw new \OCP\Files\NotFoundException();
}
$used = $rootInfo->getSize();
$used = $rootInfo->getSize($includeMountPoints);
if ($used < 0) {
$used = 0;
}
Expand Down

0 comments on commit 1e5105a

Please sign in to comment.