refcount

package
v0.0.0-...-96d2ce7 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiVersion = "v1.24" // docker engine 1.12 and above support this api version

)
View Source
const DockerHostAddr = "unix:///var/run/docker.sock"

DockerHostAddr is the docker engine sock path on Linux.

Variables

This section is empty.

Functions

This section is empty.

Types

type RefCountsMap

type RefCountsMap struct {
	StateMtx *sync.Mutex // (Exported) Synchronizes refcounting between mount/unmount and refcounting thread
	// contains filtered or unexported fields
}

RefCountsMap struct

func NewRefCountsMap

func NewRefCountsMap() *RefCountsMap

NewRefCountsMap - creates a new RefCountsMap

func (*RefCountsMap) Decr

func (r *RefCountsMap) Decr(vol string) (uint, error)

Decr recfcount for the volume vol and returns the new count returns -1 for error (and resets count to 0) also deletes the node from the map if refcount drops to 0

func (*RefCountsMap) GetCount

func (r *RefCountsMap) GetCount(vol string) uint

Returns ref count for the volume. If volume is not referred (not in the map), return 0

func (*RefCountsMap) Incr

func (r *RefCountsMap) Incr(vol string) uint

Incr refCount for the volume vol. Creates new entry if needed.

func (*RefCountsMap) Init

func (r *RefCountsMap) Init(d drivers.VolumeDriver, mountDir string, name string)

tries to calculate refCounts for dvs volumes. If failed, triggers a timer based reattempt to schedule scan after a delay

func (*RefCountsMap) IsInitialized

func (r *RefCountsMap) IsInitialized() bool

return if refcount initialization has been successful

func (*RefCountsMap) MarkDirty

func (r *RefCountsMap) MarkDirty()

dirty the background refcount process this flag is marked dirty from the driver caller acquires lock on state as appropriate

Jump to

Keyboard shortcuts

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