mount

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2016 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	// contains filtered or unexported fields
}

Collection is a data structure used for tracking live mounts.

func NewCollection

func NewCollection() *Collection

NewCollection properly initializes the Collection struct.

func (*Collection) Add

func (c *Collection) Add(mc *storage.Mount)

Add adds a mount to the collection. It is assumed that volplugin will manage the pre-existence of a live mount for the purposes of this function and this function WILL panic w/ error if given an existing mount as a duplicate.

func (*Collection) Get

func (c *Collection) Get(vol string) (*storage.Mount, error)

Get obtains the mount from the collection

func (*Collection) Remove

func (c *Collection) Remove(vol string)

Remove removes a mount from the mount collection.

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

Counter implements a tracker for specific mounts.

Each volume is assigned an integer and that integer is atomically incremented. This is used to track how many mounts a specific volume has on a given host. This is used to control mounting and heal the system if necessary.

func NewCounter

func NewCounter() *Counter

NewCounter safely constructs a *Counter.

func (*Counter) Add

func (c *Counter) Add(mp string) int

Add increments the mount counter for a volume name and returns the new value.

func (*Counter) AddCount

func (c *Counter) AddCount(mp string, n int) int

AddCount adds n to the mount counter for a volume name and returns the new value.

func (*Counter) Get

func (c *Counter) Get(mp string) int

Get obtains the mount counter for a volume name.

func (*Counter) Sub

func (c *Counter) Sub(mp string) int

Sub subtracts from the mount counter and returns the new value. Sub will panic if mount counts go less than zero.

Jump to

Keyboard shortcuts

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