You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
420 B

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. //go:build openbsd
  2. // +build openbsd
  3. package stats
  4. import (
  5. "syscall"
  6. "github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
  7. )
  8. func fillInDiskStatus(disk *volume_server_pb.DiskStatus) {
  9. fs := syscall.Statfs_t{}
  10. err := syscall.Statfs(disk.Dir, &fs)
  11. if err != nil {
  12. return
  13. }
  14. disk.All = fs.F_blocks * uint64(fs.F_bsize)
  15. disk.Free = fs.F_bfree * uint64(fs.F_bsize)
  16. calculateDiskRemaining(disk)
  17. return
  18. }