2016-11-22 19:32:10 +00:00
|
|
|
package graphdriver
|
|
|
|
|
2017-09-26 19:58:51 +00:00
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
|
|
|
|
"golang.org/x/sys/unix"
|
|
|
|
)
|
2016-11-22 19:32:10 +00:00
|
|
|
|
|
|
|
var (
|
|
|
|
// Slice of drivers that should be used in an order
|
|
|
|
priority = []string{
|
|
|
|
"zfs",
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
// Mounted checks if the given path is mounted as the fs type
|
|
|
|
func Mounted(fsType FsMagic, mountPath string) (bool, error) {
|
2017-09-26 19:58:51 +00:00
|
|
|
var buf unix.Statfs_t
|
2016-11-22 19:32:10 +00:00
|
|
|
if err := syscall.Statfs(mountPath, &buf); err != nil {
|
|
|
|
return false, err
|
|
|
|
}
|
|
|
|
return FsMagic(buf.Type) == fsType, nil
|
|
|
|
}
|