2015-04-27 07:53:12 -07:00
|
|
|
// +build linux
|
|
|
|
|
2018-02-05 16:05:59 -05:00
|
|
|
package aufs // import "github.com/docker/docker/daemon/graphdriver/aufs"
|
2013-03-20 22:41:03 -07:00
|
|
|
|
|
|
|
import (
|
2013-06-04 21:30:47 +03:00
|
|
|
"os/exec"
|
2014-07-24 13:37:44 -07:00
|
|
|
|
2017-05-23 10:22:32 -04:00
|
|
|
"golang.org/x/sys/unix"
|
2013-03-20 22:41:03 -07:00
|
|
|
)
|
|
|
|
|
2015-07-22 02:15:14 +00:00
|
|
|
// Unmount the target specified.
|
2013-03-20 22:41:03 -07:00
|
|
|
func Unmount(target string) error {
|
2013-06-04 21:30:47 +03:00
|
|
|
if err := exec.Command("auplink", target, "flush").Run(); err != nil {
|
2018-05-03 14:08:25 -07:00
|
|
|
logger.WithError(err).Warnf("Couldn't run auplink before unmount %s", target)
|
2013-06-04 21:30:47 +03:00
|
|
|
}
|
2018-01-15 00:42:25 +01:00
|
|
|
return unix.Unmount(target, 0)
|
2013-03-20 22:41:03 -07:00
|
|
|
}
|