MCPcopy
hub / github.com/containerd/containerd / UnmountMounts

Function UnmountMounts

core/mount/mount.go:62–76  ·  view source on GitHub ↗

UnmountMounts unmounts all the mounts under a target in the reverse order of the mounts array provided.

(mounts []Mount, target string, flags int)

Source from the content-addressed store, hash-verified

60// UnmountMounts unmounts all the mounts under a target in the reverse order of
61// the mounts array provided.
62func UnmountMounts(mounts []Mount, target string, flags int) error {
63 for i := len(mounts) - 1; i >= 0; i-- {
64 mountpoint, err := fs.RootPath(target, mounts[i].Target)
65 if err != nil {
66 return err
67 }
68
69 if err := UnmountAll(mountpoint, flags); err != nil {
70 if i == len(mounts)-1 { // last mount
71 return err
72 }
73 }
74 }
75 return nil
76}
77
78// CanonicalizePath makes path absolute and resolves symlinks in it.
79// Path must exist.

Callers 3

NewContainerFunction · 0.92
TestUnmountMountsFunction · 0.85
WithTempMountFunction · 0.85

Calls 1

UnmountAllFunction · 0.70

Tested by 1

TestUnmountMountsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…