Documentation ¶
Overview ¶
Package mount holds mount related files
Package mount holds mount related files ¶
Package mount holds mount related files ¶
Package mount holds mount related files
Index ¶
- Variables
- func GetVFSLinkDentryPosition(kernelVersion *skernel.Version) uint64
- func GetVFSLinkTargetDentryPosition(kernelVersion *skernel.Version) uint64
- func GetVFSMKDirDentryPosition(kernelVersion *skernel.Version) uint64
- func GetVFSRemovexattrDentryPosition(kernelVersion *skernel.Version) uint64
- func GetVFSSetxattrDentryPosition(kernelVersion *skernel.Version) uint64
- type ErrMountNotFound
- type NoOpResolver
- func (mr *NoOpResolver) DelPid(_ uint32)
- func (mr *NoOpResolver) Delete(_ uint32) error
- func (mr *NoOpResolver) Insert(_ model.Mount, _ uint32) error
- func (mr *NoOpResolver) IsMountIDValid(_ uint32) (bool, error)
- func (mr *NoOpResolver) ResolveFilesystem(_ uint32, _ uint32, _ uint32, _ string) (string, error)
- func (mr *NoOpResolver) ResolveMount(_ uint32, _ uint32, _ uint32, _ string) (*model.Mount, model.MountSource, model.MountOrigin, error)
- func (mr *NoOpResolver) ResolveMountPath(_ uint32, _ uint32, _ uint32, _ string) (string, model.MountSource, model.MountOrigin, error)
- func (mr *NoOpResolver) ResolveMountRoot(_ uint32, _ uint32, _ uint32, _ string) (string, model.MountSource, model.MountOrigin, error)
- func (mr *NoOpResolver) SendStats() error
- func (mr *NoOpResolver) SyncCache(_ uint32) error
- func (mr *NoOpResolver) ToJSON() ([]byte, error)
- type Resolver
- func (mr *Resolver) DelPid(pid uint32)
- func (mr *Resolver) Delete(mountID uint32) error
- func (mr *Resolver) Insert(m model.Mount, pid uint32) error
- func (mr *Resolver) IsMountIDValid(mountID uint32) (bool, error)
- func (mr *Resolver) ResolveFilesystem(mountID uint32, device uint32, pid uint32, containerID string) (string, error)
- func (mr *Resolver) ResolveMount(mountID uint32, device uint32, pid uint32, containerID string) (*model.Mount, model.MountSource, model.MountOrigin, error)
- func (mr *Resolver) ResolveMountPath(mountID uint32, device uint32, pid uint32, containerID string) (string, model.MountSource, model.MountOrigin, error)
- func (mr *Resolver) ResolveMountRoot(mountID uint32, device uint32, pid uint32, containerID string) (string, model.MountSource, model.MountOrigin, error)
- func (mr *Resolver) SendStats() error
- func (mr *Resolver) SyncCache(pid uint32) error
- func (mr *Resolver) ToJSON() ([]byte, error)
- type ResolverInterface
- type ResolverOpts
Constants ¶
This section is empty.
Variables ¶
var ( // ErrMountUndefined is used when a mount identifier is undefined ErrMountUndefined = errors.New("undefined mountID") // ErrMountLoop is returned when there is a resolution loop ErrMountLoop = errors.New("mount resolution loop") // ErrMountPathEmpty is returned when the resolved mount path is empty ErrMountPathEmpty = errors.New("mount resolution return empty path") // ErrMountKernelID is returned when it's not a critical error ErrMountKernelID = errors.New("not a critical error") )
Functions ¶
func GetVFSLinkDentryPosition ¶
GetVFSLinkDentryPosition gets VFS link dentry position
func GetVFSLinkTargetDentryPosition ¶
GetVFSLinkTargetDentryPosition gets VFS link target dentry position
func GetVFSMKDirDentryPosition ¶
GetVFSMKDirDentryPosition gets VFS MKDir dentry position
func GetVFSRemovexattrDentryPosition ¶
GetVFSRemovexattrDentryPosition gets VFS remove xattr dentry position
func GetVFSSetxattrDentryPosition ¶
GetVFSSetxattrDentryPosition gets VFS set xattr dentry position
Types ¶
type ErrMountNotFound ¶
type ErrMountNotFound struct {
MountID uint32
}
ErrMountNotFound is used when an unknown mount identifier is found
func (*ErrMountNotFound) Error ¶
func (e *ErrMountNotFound) Error() string
type NoOpResolver ¶
type NoOpResolver struct { }
NoOpResolver returns an empty resolver
func (*NoOpResolver) DelPid ¶
func (mr *NoOpResolver) DelPid(_ uint32)
DelPid removes the pid form the pid mapping
func (*NoOpResolver) Delete ¶
func (mr *NoOpResolver) Delete(_ uint32) error
Delete a mount from the cache
func (*NoOpResolver) Insert ¶
func (mr *NoOpResolver) Insert(_ model.Mount, _ uint32) error
Insert a new mount point in the cache
func (*NoOpResolver) IsMountIDValid ¶
func (mr *NoOpResolver) IsMountIDValid(_ uint32) (bool, error)
IsMountIDValid returns whether the mountID is valid
func (*NoOpResolver) ResolveFilesystem ¶
ResolveFilesystem returns the name of the filesystem
func (*NoOpResolver) ResolveMount ¶
func (mr *NoOpResolver) ResolveMount(_ uint32, _ uint32, _ uint32, _ string) (*model.Mount, model.MountSource, model.MountOrigin, error)
ResolveMount returns the mount
func (*NoOpResolver) ResolveMountPath ¶
func (mr *NoOpResolver) ResolveMountPath(_ uint32, _ uint32, _ uint32, _ string) (string, model.MountSource, model.MountOrigin, error)
ResolveMountPath returns the path of a mount identified by its mount ID.
func (*NoOpResolver) ResolveMountRoot ¶
func (mr *NoOpResolver) ResolveMountRoot(_ uint32, _ uint32, _ uint32, _ string) (string, model.MountSource, model.MountOrigin, error)
ResolveMountRoot returns the root of a mount identified by its mount ID.
func (*NoOpResolver) SendStats ¶
func (mr *NoOpResolver) SendStats() error
SendStats sends metrics about the current state of the mount resolver
func (*NoOpResolver) SyncCache ¶
func (mr *NoOpResolver) SyncCache(_ uint32) error
SyncCache Snapshots the current mount points of the system by reading through /proc/[pid]/mountinfo.
func (*NoOpResolver) ToJSON ¶
func (mr *NoOpResolver) ToJSON() ([]byte, error)
ToJSON return a json version of the cache
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver represents a cache for mountpoints and the corresponding file systems
func NewResolver ¶
func NewResolver(statsdClient statsd.ClientInterface, cgroupsResolver *cgroup.Resolver, opts ResolverOpts) (*Resolver, error)
NewResolver instantiates a new mount resolver
func (*Resolver) IsMountIDValid ¶
IsMountIDValid returns whether the mountID is valid
func (*Resolver) ResolveFilesystem ¶
func (mr *Resolver) ResolveFilesystem(mountID uint32, device uint32, pid uint32, containerID string) (string, error)
ResolveFilesystem returns the name of the filesystem
func (*Resolver) ResolveMount ¶
func (mr *Resolver) ResolveMount(mountID uint32, device uint32, pid uint32, containerID string) (*model.Mount, model.MountSource, model.MountOrigin, error)
ResolveMount returns the mount
func (*Resolver) ResolveMountPath ¶
func (mr *Resolver) ResolveMountPath(mountID uint32, device uint32, pid uint32, containerID string) (string, model.MountSource, model.MountOrigin, error)
ResolveMountPath returns the path of a mount identified by its mount ID.
func (*Resolver) ResolveMountRoot ¶
func (mr *Resolver) ResolveMountRoot(mountID uint32, device uint32, pid uint32, containerID string) (string, model.MountSource, model.MountOrigin, error)
ResolveMountRoot returns the root of a mount identified by its mount ID.
type ResolverInterface ¶
type ResolverInterface interface { IsMountIDValid(mountID uint32) (bool, error) SyncCache(pid uint32) error Delete(mountID uint32) error ResolveFilesystem(mountID uint32, device uint32, pid uint32, containerID string) (string, error) Insert(m model.Mount, pid uint32) error DelPid(pid uint32) ResolveMountRoot(mountID uint32, device uint32, pid uint32, containerID string) (string, model.MountSource, model.MountOrigin, error) ResolveMountPath(mountID uint32, device uint32, pid uint32, containerID string) (string, model.MountSource, model.MountOrigin, error) ResolveMount(mountID uint32, device uint32, pid uint32, containerID string) (*model.Mount, model.MountSource, model.MountOrigin, error) SendStats() error ToJSON() ([]byte, error) }
ResolverInterface defines the resolver interface
type ResolverOpts ¶
type ResolverOpts struct {
UseProcFS bool
}
ResolverOpts defines mount resolver options