Documentation ¶
Index ¶
- Constants
- type RefCountsMap
- func (r *RefCountsMap) Decr(vol string) (uint, error)
- func (r *RefCountsMap) GetCount(vol string) uint
- func (r *RefCountsMap) Incr(vol string) uint
- func (r *RefCountsMap) Init(d drivers.VolumeDriver, mountDir string, name string)
- func (r *RefCountsMap) IsInitialized() bool
- func (r *RefCountsMap) MarkDirty()
Constants ¶
const (
ApiVersion = "v1.24" // docker engine 1.12 and above support this api version
)
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