Abstract ismountpoint and use platform mounter for NFS volume

This commit is contained in:
Deyuan Deng
2015-03-31 22:08:33 -04:00
committed by Deyuan Deng
parent 2de37624e8
commit d62afa85ff
12 changed files with 70 additions and 92 deletions

View File

@@ -27,10 +27,12 @@ import (
const linuxTmpfsMagic = 0x01021994
// realMountDetector implements mountDetector in terms of syscalls.
type realMountDetector struct{}
type realMountDetector struct {
mounter mount.Interface
}
func (m *realMountDetector) GetMountMedium(path string) (storageMedium, bool, error) {
isMnt, err := mount.IsMountPoint(path)
isMnt, err := m.mounter.IsMountPoint(path)
if err != nil {
return 0, false, fmt.Errorf("IsMountPoint(%q): %v", path, err)
}