package devmapper

import "github.com/docker/docker/daemon/graphdriver/devmapper"

Index

Variables

var (
	DefaultDataLoopbackSize     int64  = 100 * 1024 * 1024 * 1024
	DefaultMetaDataLoopbackSize int64  = 2 * 1024 * 1024 * 1024
	DefaultBaseFsSize           uint64 = 100 * 1024 * 1024 * 1024
	DefaultThinpBlockSize       uint32 = 128 // 64K = 128 512b sectors
	DefaultUdevSyncOverride     bool   = false
	MaxDeviceId                 int    = 0xffffff // 24 bit, pool limit
	DeviceIdMapSz               int    = (MaxDeviceId + 1) / 8
	// We retry device removal so many a times that even error messages
	// will fill up console during normal operation. So only log Fatal
	// messages by default.
	DMLogLevel                   int  = devicemapper.LogLevelFatal
	DriverDeferredRemovalSupport bool = false
	EnableDeferredRemoval        bool = false
)

Functions

func Init

func Init(home string, options []string) (graphdriver.Driver, error)

func Mounted

func Mounted(mountpoint string) (bool, error)

func ProbeFsType

func ProbeFsType(device string) (string, error)

Types

type DevInfo

type DevInfo struct {
	Hash          string `json:"-"`
	DeviceId      int    `json:"device_id"`
	Size          uint64 `json:"size"`
	TransactionId uint64 `json:"transaction_id"`
	Initialized   bool   `json:"initialized"`
	// contains filtered or unexported fields
}

func (*DevInfo) DevName

func (info *DevInfo) DevName() string

func (*DevInfo) Name

func (info *DevInfo) Name() string

type DevStatus

type DevStatus struct {
	DeviceId            int
	Size                uint64
	TransactionId       uint64
	SizeInSectors       uint64
	MappedSectors       uint64
	HighestMappedSector uint64
}

type DeviceMetadata

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

Structure used to export image/container metadata in docker inspect.

type DeviceSet

type DeviceSet struct {
	MetaData   `json:"-"`
	sync.Mutex `json:"-"` // Protects Devices map and serializes calls into libdevmapper

	TransactionId uint64 `json:"-"`
	NextDeviceId  int    `json:"next_device_id"`

	Transaction `json:"-"`

	BaseDeviceUUID string //save UUID of base device
	// contains filtered or unexported fields
}

func NewDeviceSet

func NewDeviceSet(root string, doInit bool, options []string) (*DeviceSet, error)

func (*DeviceSet) AddDevice

func (devices *DeviceSet) AddDevice(hash, baseHash string) error

func (*DeviceSet) DMLog

func (devices *DeviceSet) DMLog(level int, file string, line int, dmError int, message string)

func (*DeviceSet) DataDevicePath

func (devices *DeviceSet) DataDevicePath() string

DataDevicePath returns the path to the data storage for this deviceset, regardless of loopback or block device

func (*DeviceSet) DeleteDevice

func (devices *DeviceSet) DeleteDevice(hash string) error

func (*DeviceSet) ExportDeviceMetadata

func (devices *DeviceSet) ExportDeviceMetadata(hash string) (*DeviceMetadata, error)

Status returns the current status of this deviceset

func (*DeviceSet) GetDeviceStatus

func (devices *DeviceSet) GetDeviceStatus(hash string) (*DevStatus, error)

func (*DeviceSet) HasActivatedDevice

func (devices *DeviceSet) HasActivatedDevice(hash string) bool

func (*DeviceSet) HasDevice

func (devices *DeviceSet) HasDevice(hash string) bool

func (*DeviceSet) List

func (devices *DeviceSet) List() []string

func (*DeviceSet) MetadataDevicePath

func (devices *DeviceSet) MetadataDevicePath() string

MetadataDevicePath returns the path to the metadata storage for this deviceset, regardless of loopback or block device

func (*DeviceSet) MountDevice

func (devices *DeviceSet) MountDevice(hash, path, mountLabel string) error

func (*DeviceSet) ResizePool

func (devices *DeviceSet) ResizePool(size int64) error

func (*DeviceSet) Shutdown

func (devices *DeviceSet) Shutdown() error

func (*DeviceSet) Status

func (devices *DeviceSet) Status() *Status

Status returns the current status of this deviceset

func (*DeviceSet) UnmountDevice

func (devices *DeviceSet) UnmountDevice(hash string) error

type DiskUsage

type DiskUsage struct {
	Used      uint64
	Total     uint64
	Available uint64
}

type Driver

type Driver struct {
	*DeviceSet
	// contains filtered or unexported fields
}

func (*Driver) Cleanup

func (d *Driver) Cleanup() error

func (*Driver) Create

func (d *Driver) Create(id, parent string) error

func (*Driver) Exists

func (d *Driver) Exists(id string) bool

func (*Driver) Get

func (d *Driver) Get(id, mountLabel string) (string, error)

func (*Driver) GetMetadata

func (d *Driver) GetMetadata(id string) (map[string]string, error)

func (*Driver) Put

func (d *Driver) Put(id string) error

func (*Driver) Remove

func (d *Driver) Remove(id string) error

func (*Driver) Status

func (d *Driver) Status() [][2]string

func (*Driver) String

func (d *Driver) String() string

type MetaData

type MetaData struct {
	Devices map[string]*DevInfo `json:"Devices"`
	// contains filtered or unexported fields
}

type Status

type Status struct {
	PoolName              string
	DataFile              string // actual block device for data
	DataLoopback          string // loopback file, if used
	MetadataFile          string // actual block device for metadata
	MetadataLoopback      string // loopback file, if used
	Data                  DiskUsage
	Metadata              DiskUsage
	SectorSize            uint64
	UdevSyncSupported     bool
	DeferredRemoveEnabled bool
}

type Transaction

type Transaction struct {
	OpenTransactionId uint64 `json:"open_transaction_id"`
	DeviceIdHash      string `json:"device_hash"`
	DeviceId          int    `json:"device_id"`
}

Source Files

deviceset.go devmapper_doc.go driver.go mount.go

Version
v1.8.3
Published
Oct 12, 2015
Platform
linux/amd64
Imports
22 packages
Last checked
24 minutes ago

Tools for package owners.