github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/daemon/graphdriver/driver_freebsd.go (about)

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