2015-07-29 18:25:56 +00:00
|
|
|
package graphdriver
|
|
|
|
|
2017-08-21 21:06:56 +00:00
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
|
|
|
|
"golang.org/x/sys/unix"
|
|
|
|
)
|
2016-03-09 21:23:04 +00:00
|
|
|
|
2015-07-29 18:25:56 +00:00
|
|
|
var (
|
|
|
|
// Slice of drivers that should be used in an order
|
|
|
|
priority = []string{
|
|
|
|
"zfs",
|
|
|
|
}
|
|
|
|
)
|
2016-03-09 21:23:04 +00:00
|
|
|
|
|
|
|
// Mounted checks if the given path is mounted as the fs type
|
|
|
|
func Mounted(fsType FsMagic, mountPath string) (bool, error) {
|
2017-05-23 14:22:32 +00:00
|
|
|
var buf unix.Statfs_t
|
2016-03-09 21:23:04 +00:00
|
|
|
if err := syscall.Statfs(mountPath, &buf); err != nil {
|
|
|
|
return false, err
|
|
|
|
}
|
|
|
|
return FsMagic(buf.Type) == fsType, nil
|
|
|
|
}
|