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
433 B

  1. //go:build solaris
  2. // +build solaris
  3. package stats
  4. import (
  5. "golang.org/x/sys/unix"
  6. "github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
  7. )
  8. func fillInDiskStatus(disk *volume_server_pb.DiskStatus) {
  9. var stat unix.Statvfs_t
  10. err := unix.Statvfs(disk.Dir, &stat)
  11. if err != nil {
  12. return
  13. }
  14. disk.All = stat.Blocks * uint64(stat.Bsize)
  15. disk.Free = stat.Bfree * uint64(stat.Bsize)
  16. calculateDiskRemaining(disk)
  17. return
  18. }