mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
Rename IsMountPoint to IsLikelyNotMountPoint
IsLikelyNotMountPoint determines if a directory is not a mountpoint.
It is fast but not necessarily ALWAYS correct. If the path is in fact
a bind mount from one part of a mount to another it will not be detected.
mkdir /tmp/a /tmp/b; mount --bin /tmp/a /tmp/b; IsLikelyNotMountPoint("/tmp/b")
will return true. When in fact /tmp/b is a mount point. So this patch
renames the function and switches it from a positive to a negative (I
could think of a good positive name). This should make future users of
this function aware that it isn't quite perfect, but probably good
enough.
This commit is contained in:
@@ -30,8 +30,8 @@ type Interface interface {
|
||||
// it could change between chunked reads). This is guaranteed to be
|
||||
// consistent.
|
||||
List() ([]MountPoint, error)
|
||||
// IsMountPoint determines if a directory is a mountpoint.
|
||||
IsMountPoint(file string) (bool, error)
|
||||
// IsLikelyNotMountPoint determines if a directory is a mountpoint.
|
||||
IsLikelyNotMountPoint(file string) (bool, error)
|
||||
}
|
||||
|
||||
// This represents a single line in /proc/mounts or /etc/fstab.
|
||||
|
||||
Reference in New Issue
Block a user