Skip to content

Commit

Permalink
apply feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Feb 18, 2021
1 parent d080ab3 commit b7564d3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion internal/grpc/services/gateway/storageprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,6 @@ func (s *svc) PurgeRecycle(ctx context.Context, req *gateway.PurgeRecycleRequest
}

func (s *svc) GetQuota(ctx context.Context, req *gateway.GetQuotaRequest) (*provider.GetQuotaResponse, error) {
// lookup storage by treating the key as a path. It has been prefixed with the storage path in ListRecycle
c, err := s.find(ctx, req.Ref)
if err != nil {
return &provider.GetQuotaResponse{
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/fs/ocis/ocis.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (fs *ocisfs) GetQuota(ctx context.Context) (uint64, uint64, error) {
return 0, 0, err
}

total := +ri.Size + (stat.Bavail * uint64(stat.Bsize)) // used treesize + available space
total := ri.Size + (stat.Bavail * uint64(stat.Bsize)) // used treesize + available space

switch {
case quotaStr == _quotaUncalculated, quotaStr == _quotaUnknown, quotaStr == _quotaUnlimited:
Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/utils/localfs/localfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,8 @@ func (fs *localfs) GetQuota(ctx context.Context) (uint64, uint64, error) {
if err != nil {
return 0, 0, err
}
total := stat.Blocks * uint64(stat.Bsize) // Total data blocks in filesystem
used := stat.Bavail * uint64(stat.Bsize) // Free blocks available to unprivileged user
total := stat.Blocks * uint64(stat.Bsize) // Total data blocks in filesystem
used := (stat.Blocks - stat.Bavail) * uint64(stat.Bsize) // Free blocks available to unprivileged user
return total, used, nil
}

Expand Down

0 comments on commit b7564d3

Please sign in to comment.