From c0788c1f211383d7e1f3460cc997c9edbe7f3fe9 Mon Sep 17 00:00:00 2001 From: Yecheng Fu Date: Sun, 27 Oct 2019 15:55:07 +0800 Subject: [PATCH] Update GetMountRefs comments --- pkg/util/mount/mount.go | 2 +- pkg/util/mount/mount_linux.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/util/mount/mount.go b/pkg/util/mount/mount.go index 7324d691144..7d94a48f4b0 100644 --- a/pkg/util/mount/mount.go +++ b/pkg/util/mount/mount.go @@ -48,7 +48,7 @@ type Interface interface { // most notably linux bind mounts and symbolic link. IsLikelyNotMountPoint(file string) (bool, error) // GetMountRefs finds all mount references to the path, returns a - // list of paths. Path could be a mountpoint path, device or a normal + // list of paths. Path could be a mountpoint or a normal // directory (for bind mount). GetMountRefs(pathname string) ([]string, error) } diff --git a/pkg/util/mount/mount_linux.go b/pkg/util/mount/mount_linux.go index dfd52bfe105..c0c4b0dd823 100644 --- a/pkg/util/mount/mount_linux.go +++ b/pkg/util/mount/mount_linux.go @@ -238,7 +238,7 @@ func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) { } // GetMountRefs finds all mount references to pathname, returns a -// list of paths. Path could be a mountpoint path, device or a normal +// list of paths. Path could be a mountpoint or a normal // directory (for bind mount). func (mounter *Mounter) GetMountRefs(pathname string) ([]string, error) { pathExists, pathErr := PathExists(pathname) @@ -441,7 +441,8 @@ func parseProcMounts(content []byte) ([]MountPoint, error) { // SearchMountPoints finds all mount references to the source, returns a list of // mountpoints. -// This function assumes source cannot be device. +// The source can be a mount point or a normal directory (bind mount). We +// didn't support device because there is no use case by now. // Some filesystems may share a source name, e.g. tmpfs. And for bind mounting, // it's possible to mount a non-root path of a filesystem, so we need to use // root path and major:minor to represent mount source uniquely.