mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
20 lines
342 B
Go
20 lines
342 B
Go
![]() |
// +build !windows,!openbsd,!netbsd,!plan9
|
||
|
|
||
|
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
|
||
|
}
|