diff options
| author | chrislu <chris.lu@gmail.com> | 2022-03-06 17:22:49 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-03-06 17:22:49 -0800 |
| commit | 46a28b8819b96deecf2aae7a19cb4bd6da29012b (patch) | |
| tree | d82a6461d19df38000ccdb9f3c2fe7f6b1bb8f8e | |
| parent | ede6ce44c6054cdec9be9127fe3446bad93f7259 (diff) | |
| download | seaweedfs-46a28b8819b96deecf2aae7a19cb4bd6da29012b.tar.xz seaweedfs-46a28b8819b96deecf2aae7a19cb4bd6da29012b.zip | |
mount: adjust disk space based on quota
| -rw-r--r-- | weed/mount/weedfs_stats.go | 7 |
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 |
