mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
6fcb36ff14
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
29 lines
423 B
Go
29 lines
423 B
Go
// +build !windows
|
|
|
|
package snapshot
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
|
|
"github.com/containerd/containerd/mount"
|
|
)
|
|
|
|
func (lm *localMounter) Unmount() error {
|
|
lm.mu.Lock()
|
|
defer lm.mu.Unlock()
|
|
|
|
if lm.target != "" {
|
|
if err := mount.Unmount(lm.target, syscall.MNT_DETACH); err != nil {
|
|
return err
|
|
}
|
|
os.RemoveAll(lm.target)
|
|
lm.target = ""
|
|
}
|
|
|
|
if lm.mountable != nil {
|
|
return lm.mountable.Release()
|
|
}
|
|
|
|
return nil
|
|
}
|