1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-06-28 05:12:13 +02:00
seaweedfs/weed/stats/disk_supported.go
Chris Lu 5ce6bbf076 directory structure change to work with glide
glide has its own requirements. My previous workaround caused me some
code checkin errors. Need to fix this.
2016-06-02 18:09:14 -07:00

20 lines
351 B
Go

// +build !windows,!openbsd,!netbsd,!plan9,!solaris
package stats
import (
"syscall"
)
func (disk *DiskStatus) fillInStatus() {
fs := syscall.Statfs_t{}
err := syscall.Statfs(disk.Dir, &fs)
if err != nil {
return
}
disk.All = fs.Blocks * uint64(fs.Bsize)
disk.Free = fs.Bfree * uint64(fs.Bsize)
disk.Used = disk.All - disk.Free
return
}