2015-07-29 14:25:56 -04:00
|
|
|
package graphdriver
|
|
|
|
|
2017-05-23 10:22:32 -04:00
|
|
|
import "golang.org/x/sys/unix"
|
2016-03-09 16:23:04 -05:00
|
|
|
|
2015-07-29 14:25:56 -04:00
|
|
|
var (
|
|
|
|
// Slice of drivers that should be used in an order
|
|
|
|
priority = []string{
|
|
|
|
"zfs",
|
|
|
|
}
|
|
|
|
)
|
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
|
|
|
|
}
|