Browse Source

mount: adjust disk space based on quota

pull/2731/head
chrislu 3 years ago
parent
commit
46a28b8819
  1. 7
      weed/mount/weedfs_stats.go

7
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

Loading…
Cancel
Save