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