func GetFSMagic(rootpath string) (FsMagic, error) {
	var buf syscall.Statfs_t
	if err := syscall.Statfs(filepath.Dir(rootpath), &buf); err != nil {
		return 0, err
	}
	return FsMagic(buf.Type), nil
}
GetFSMagic returns the filesystem id given the path.
package graphdriver
import (
	"path/filepath"
	"syscall"
	"github.com/docker/docker/pkg/mount"
)
const (
	FsMagicAufs = FsMagic(0x61756673)
	FsMagicBtrfs = FsMagic(0x9123683E)
	FsMagicCramfs = FsMagic(0x28cd3d45)
	FsMagicEcryptfs = FsMagic(0xf15f)
	FsMagicExtfs = FsMagic(0x0000EF53)
	FsMagicF2fs = FsMagic(0xF2F52010)
	FsMagicGPFS = FsMagic(0x47504653)
	FsMagicJffs2Fs = FsMagic(0x000072b6)
	FsMagicJfs = FsMagic(0x3153464a)
	FsMagicNfsFs = FsMagic(0x00006969)
	FsMagicRAMFs = FsMagic(0x858458f6)
	FsMagicReiserFs = FsMagic(0x52654973)
	FsMagicSmbFs = FsMagic(0x0000517B)
	FsMagicSquashFs = FsMagic(0x73717368)
	FsMagicTmpFs = FsMagic(0x01021994)
	FsMagicVxFS = FsMagic(0xa501fcf5)
	FsMagicXfs = FsMagic(0x58465342)
	FsMagicZfs = FsMagic(0x2fc12fc1)
	FsMagicOverlay = FsMagic(0x794C7630)
)
var (
	priority = []string{
		"aufs",
		"btrfs",
		"zfs",
		"overlay2",
		"overlay",
		"devicemapper",
		"vfs",
	}
	FsNames = map[FsMagic]string{
		FsMagicAufs:        "aufs",
		FsMagicBtrfs:       "btrfs",
		FsMagicCramfs:      "cramfs",
		FsMagicExtfs:       "extfs",
		FsMagicF2fs:        "f2fs",
		FsMagicGPFS:        "gpfs",
		FsMagicJffs2Fs:     "jffs2",
		FsMagicJfs:         "jfs",
		FsMagicNfsFs:       "nfs",
		FsMagicOverlay:     "overlayfs",
		FsMagicRAMFs:       "ramfs",
		FsMagicReiserFs:    "reiserfs",
		FsMagicSmbFs:       "smb",
		FsMagicSquashFs:    "squashfs",
		FsMagicTmpFs:       "tmpfs",
		FsMagicUnsupported: "unsupported",
		FsMagicVxFS:        "vxfs",
		FsMagicXfs:         "xfs",
		FsMagicZfs:         "zfs",
	}
)