Skip to content

devmapper.Mounted: remove #36437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions daemon/graphdriver/devmapper/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this was added a loooong time ago (4a8a7d4), and was to satisfy an interface that later changed (b8b509e / shykes#7). Looks like in aufs this is now moved to graphdriver.Mounted() (in 65d79e3):

func (a *Driver) mounted(mountpoint string) (bool, error) {
return graphdriver.Mounted(graphdriver.FsMagicAufs, mountpoint)
}


// 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
Expand Down