mountinfo

package
v1.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2016 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterFunc

type FilterFunc func(m *Mount) bool

FilterFunc is a functional type which returns true if the given Mount should be filtered, else false.

func HasPrefix

func HasPrefix(p string) FilterFunc

HasPrefix returns a FilterFunc which returns true if the mountpoint of a given mount has prefix p, else false.

type Mount

type Mount struct {
	ID         int
	Parent     int
	Major      int
	Minor      int
	Root       string
	MountPoint string
	Opts       map[string]struct{}
}

Mount contains information about a single mountpoint entry

func (*Mount) NeedsRemountPrivate

func (m *Mount) NeedsRemountPrivate() bool

NeedsRemountPrivate checks if this mountPoint needs to be remounted as private, in order for children to be properly unmounted without leaking to parents.

type Mounts

type Mounts []*Mount

Mounts represents a sortable set of mountpoint entries. It implements sort.Interface according to unmount order (children first).

func ParseMounts

func ParseMounts(pid uint) (Mounts, error)

ParseMounts returns all mountpoints associated with a process mount namespace. The special value 0 as pid argument is used to specify the current process.

func (Mounts) Filter

func (ms Mounts) Filter(f FilterFunc) Mounts

Filter returns a filtered copy of Mounts

func (Mounts) Len

func (ms Mounts) Len() int

func (Mounts) Less

func (ms Mounts) Less(i, j int) (result bool)

Less ensures that mounts are sorted in an order we can unmount; descendant before ancestor. The requirement of transitivity for Less has to be fulfilled otherwise the sort algorithm will fail.

func (Mounts) Swap

func (ms Mounts) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL