Merge pull request #8867 from vbatts/vbatts-relocate_mount_operation
mount: move the MakePrivate to pkg/mount
This commit is contained in:
commit
afbc7f550b
1 changed files with 18 additions and 0 deletions
18
mount/sharedsubtree_linux.go
Normal file
18
mount/sharedsubtree_linux.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
// +build linux
|
||||
|
||||
package mount
|
||||
|
||||
func MakePrivate(mountPoint string) error {
|
||||
mounted, err := Mounted(mountPoint)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !mounted {
|
||||
if err := Mount(mountPoint, mountPoint, "none", "bind,rw"); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return ForceMount("", mountPoint, "none", "private")
|
||||
}
|
Loading…
Reference in a new issue