Skip to content

Commit 00deec8

Browse files
authored
Merge pull request kubernetes#84413 from cofyc/update-mount-comments
cleanup: Update comments of SearchMountPoints/GetMountRefs
2 parents ef479c1 + c0788c1 commit 00deec8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pkg/util/mount/mount.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type Interface interface {
4848
// most notably linux bind mounts and symbolic link.
4949
IsLikelyNotMountPoint(file string) (bool, error)
5050
// GetMountRefs finds all mount references to the path, returns a
51-
// list of paths. Path could be a mountpoint path, device or a normal
51+
// list of paths. Path could be a mountpoint or a normal
5252
// directory (for bind mount).
5353
GetMountRefs(pathname string) ([]string, error)
5454
}

pkg/util/mount/mount_linux.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) {
238238
}
239239

240240
// GetMountRefs finds all mount references to pathname, returns a
241-
// list of paths. Path could be a mountpoint path, device or a normal
241+
// list of paths. Path could be a mountpoint or a normal
242242
// directory (for bind mount).
243243
func (mounter *Mounter) GetMountRefs(pathname string) ([]string, error) {
244244
pathExists, pathErr := PathExists(pathname)
@@ -441,7 +441,8 @@ func parseProcMounts(content []byte) ([]MountPoint, error) {
441441

442442
// SearchMountPoints finds all mount references to the source, returns a list of
443443
// mountpoints.
444-
// This function assumes source cannot be device.
444+
// The source can be a mount point or a normal directory (bind mount). We
445+
// didn't support device because there is no use case by now.
445446
// Some filesystems may share a source name, e.g. tmpfs. And for bind mounting,
446447
// it's possible to mount a non-root path of a filesystem, so we need to use
447448
// root path and major:minor to represent mount source uniquely.

0 commit comments

Comments
 (0)