driver_freebsd.go 470 B

12345678910111213141516171819
  1. package graphdriver // import "github.com/docker/docker/daemon/graphdriver"
  2. import (
  3. "syscall"
  4. "golang.org/x/sys/unix"
  5. )
  6. // List of drivers that should be used in an order
  7. var priority = "zfs"
  8. // Mounted checks if the given path is mounted as the fs type
  9. func Mounted(fsType FsMagic, mountPath string) (bool, error) {
  10. var buf unix.Statfs_t
  11. if err := syscall.Statfs(mountPath, &buf); err != nil {
  12. return false, err
  13. }
  14. return FsMagic(buf.Type) == fsType, nil
  15. }