aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-03-06 17:22:49 -0800
committerchrislu <chris.lu@gmail.com>2022-03-06 17:22:49 -0800
commit46a28b8819b96deecf2aae7a19cb4bd6da29012b (patch)
treed82a6461d19df38000ccdb9f3c2fe7f6b1bb8f8e
parentede6ce44c6054cdec9be9127fe3446bad93f7259 (diff)
downloadseaweedfs-46a28b8819b96deecf2aae7a19cb4bd6da29012b.tar.xz
seaweedfs-46a28b8819b96deecf2aae7a19cb4bd6da29012b.zip
mount: adjust disk space based on quota
-rw-r--r--weed/mount/weedfs_stats.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/weed/mount/weedfs_stats.go b/weed/mount/weedfs_stats.go
index 0da41ab0b..21f664889 100644
--- a/weed/mount/weedfs_stats.go
+++ b/weed/mount/weedfs_stats.go
@@ -57,6 +57,13 @@ func (wfs *WFS) StatFs(cancel <-chan struct{}, in *fuse.InHeader, out *fuse.Stat
usedDiskSize := wfs.stats.UsedSize
actualFileCount := wfs.stats.FileCount
+ if wfs.option.Quota > 0 && totalDiskSize > uint64(wfs.option.Quota) {
+ totalDiskSize = uint64(wfs.option.Quota)
+ if usedDiskSize > totalDiskSize {
+ totalDiskSize = usedDiskSize
+ }
+ }
+
// Compute the total number of available blocks
out.Blocks = totalDiskSize / blockSize