Merge pull request #36437 from kolyshkin/dm-unused

devmapper.Mounted: remove
Upstream-commit: a6b1d2ea297827d763de9e4b1940434e00a37883
Component: engine
This commit is contained in:
Brian Goff
2018-03-05 18:14:36 -08:00
committed by GitHub

View File

@ -6,30 +6,8 @@ import (
"bytes"
"fmt"
"os"
"path/filepath"
"golang.org/x/sys/unix"
)
// FIXME: this is copy-pasted from the aufs driver.
// It should be moved into the core.
// Mounted returns true if a mount point exists.
func Mounted(mountpoint string) (bool, error) {
var mntpointSt unix.Stat_t
if err := unix.Stat(mountpoint, &mntpointSt); err != nil {
if os.IsNotExist(err) {
return false, nil
}
return false, err
}
var parentSt unix.Stat_t
if err := unix.Stat(filepath.Join(mountpoint, ".."), &parentSt); err != nil {
return false, err
}
return mntpointSt.Dev != parentSt.Dev, nil
}
type probeData struct {
fsName string
magic string