2018-02-05 21:05:59 +00:00
|
|
|
package graphdriver // import "github.com/docker/docker/daemon/graphdriver"
|
2015-07-29 18:25:56 +00:00
|
|
|
|
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 (
|
2017-11-15 21:54:56 +00:00
|
|
|
// List of drivers that should be used in an order
|
|
|
|
priority = "zfs"
|
2015-07-29 18:25:56 +00:00
|
|
|
)
|
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
|
|
|
|
}
|