mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
359b7df5d2
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
27 lines
564 B
Go
27 lines
564 B
Go
// +build linux,amd64
|
|
|
|
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) {
|
|
mntpoint, err := osStat(mountpoint)
|
|
if err != nil {
|
|
if osIsNotExist(err) {
|
|
return false, nil
|
|
}
|
|
return false, err
|
|
}
|
|
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
|
|
}
|