disk_solaris.go 433 B

123456789101112131415161718192021222324
  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. }