Signed-off-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
20 lines
364 B
Go
20 lines
364 B
Go
//go:build linux || darwin || freebsd
|
|
|
|
package overlayfs
|
|
|
|
import (
|
|
"path/filepath"
|
|
"syscall"
|
|
)
|
|
|
|
func (over Overlayfs) Statfs(path string) (total, free uint64, err error) {
|
|
if over.isRW() {
|
|
stat := new(syscall.Statfs_t)
|
|
if err = syscall.Statfs(filepath.Join(over.Upper, path), stat); err == nil {
|
|
total = stat.Blocks
|
|
free = stat.Bfree
|
|
}
|
|
}
|
|
return
|
|
}
|