Updates moby/sys mountinfo package to v0.6.0

Update to moby/sys/mountinfo package that contains MountedFast
function. The function uses OpenAt2 call for newer kernels
to determine if a mount-point is present or not.
This commit is contained in:
Manu Gupta
2022-03-19 16:09:21 -07:00
parent 475f7af1c1
commit f9abf7e7ac
11 changed files with 92 additions and 59 deletions

View File

@@ -10,11 +10,12 @@ func GetMounts(f FilterFunc) ([]*Info, error) {
return parseMountTable(f)
}
// Mounted determines if a specified path is a mount point.
// Mounted determines if a specified path is a mount point. In case of any
// error, false (and an error) is returned.
//
// The argument must be an absolute path, with all symlinks resolved, and clean.
// One way to ensure it is to process the path using filepath.Abs followed by
// filepath.EvalSymlinks before calling this function.
// If a non-existent path is specified, an appropriate error is returned.
// In case the caller is not interested in this particular error, it should
// be handled separately using e.g. errors.Is(err, os.ErrNotExist).
func Mounted(path string) (bool, error) {
// root is always mounted
if path == string(os.PathSeparator) {