1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/graphdriver/devmapper/mount.go

26 lines
541 B
Go
Raw Normal View History

package devmapper
import (
"path/filepath"
)
// FIXME: this is copy-pasted from the aufs driver.
// It should be moved into the core.
var Mounted = func(mountpoint string) (bool, error) {
2013-11-20 16:05:17 -05:00
mntpoint, err := osStat(mountpoint)
if err != nil {
2013-11-20 16:05:17 -05:00
if osIsNotExist(err) {
return false, nil
}
return false, err
}
2013-11-20 16:05:17 -05:00
parent, err := osStat(filepath.Join(mountpoint, ".."))
if err != nil {
return false, err
}
mntpointSt := toSysStatT(mntpoint.Sys())
parentSt := toSysStatT(parent.Sys())
return mntpointSt.Dev != parentSt.Dev, nil
}