1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-06-01 08:12:02 +02:00

mount: adjust disk space based on quota

This commit is contained in:
chrislu 2022-03-06 17:22:49 -08:00
parent ede6ce44c6
commit 46a28b8819

View file

@ -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