mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update k8s.io/mount-utils to current master
kubernetes/kubernetes#111083 has been merged and synced into k8s.io/mount-utils. This should remove any systemd log messages while calling NodeStageVolume and NodeGetVolumeStats. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
3c3cbc8005
commit
533994daff
67
vendor/github.com/moby/sys/mountinfo/mountinfo.go
generated
vendored
Normal file
67
vendor/github.com/moby/sys/mountinfo/mountinfo.go
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
package mountinfo
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// GetMounts retrieves a list of mounts for the current running process,
|
||||
// with an optional filter applied (use nil for no filter).
|
||||
func GetMounts(f FilterFunc) ([]*Info, error) {
|
||||
return parseMountTable(f)
|
||||
}
|
||||
|
||||
// Mounted determines if a specified path is a mount point. In case of any
|
||||
// error, false (and an error) is returned.
|
||||
//
|
||||
// If a non-existent path is specified, an appropriate error is returned.
|
||||
// In case the caller is not interested in this particular error, it should
|
||||
// be handled separately using e.g. errors.Is(err, os.ErrNotExist).
|
||||
func Mounted(path string) (bool, error) {
|
||||
// root is always mounted
|
||||
if path == string(os.PathSeparator) {
|
||||
return true, nil
|
||||
}
|
||||
return mounted(path)
|
||||
}
|
||||
|
||||
// Info reveals information about a particular mounted filesystem. This
|
||||
// struct is populated from the content in the /proc/<pid>/mountinfo file.
|
||||
type Info struct {
|
||||
// ID is a unique identifier of the mount (may be reused after umount).
|
||||
ID int
|
||||
|
||||
// Parent is the ID of the parent mount (or of self for the root
|
||||
// of this mount namespace's mount tree).
|
||||
Parent int
|
||||
|
||||
// Major and Minor are the major and the minor components of the Dev
|
||||
// field of unix.Stat_t structure returned by unix.*Stat calls for
|
||||
// files on this filesystem.
|
||||
Major, Minor int
|
||||
|
||||
// Root is the pathname of the directory in the filesystem which forms
|
||||
// the root of this mount.
|
||||
Root string
|
||||
|
||||
// Mountpoint is the pathname of the mount point relative to the
|
||||
// process's root directory.
|
||||
Mountpoint string
|
||||
|
||||
// Options is a comma-separated list of mount options.
|
||||
Options string
|
||||
|
||||
// Optional are zero or more fields of the form "tag[:value]",
|
||||
// separated by a space. Currently, the possible optional fields are
|
||||
// "shared", "master", "propagate_from", and "unbindable". For more
|
||||
// information, see mount_namespaces(7) Linux man page.
|
||||
Optional string
|
||||
|
||||
// FSType is the filesystem type in the form "type[.subtype]".
|
||||
FSType string
|
||||
|
||||
// Source is filesystem-specific information, or "none".
|
||||
Source string
|
||||
|
||||
// VFSOptions is a comma-separated list of superblock options.
|
||||
VFSOptions string
|
||||
}
|
Reference in New Issue
Block a user