blob: 4e285c6c0b99ef55649ae708fbe8fc95fe152650 [file] [log] [blame]
// +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.release != nil {
return lm.release()
}
return nil
}