devmapper

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

+build linux

Index

Constants

View Source
const (
	DRIVER_NAME           = "devicemapper"
	DEFAULT_THINPOOL_NAME = "rancher-volume-pool"
	DEFAULT_BLOCK_SIZE    = "4096"
	DM_DIR                = "/dev/mapper/"

	DM_DATA_DEV            = "dm.datadev"
	DM_METADATA_DEV        = "dm.metadatadev"
	DM_THINPOOL_NAME       = "dm.thinpoolname"
	DM_THINPOOL_BLOCK_SIZE = "dm.thinpoolblocksize"

	// as defined in device mapper thin provisioning
	BLOCK_SIZE_MIN        = 128
	BLOCK_SIZE_MAX        = 2097152
	BLOCK_SIZE_MULTIPLIER = 128

	SECTOR_SIZE = 512
)

Variables

This section is empty.

Functions

func Init

func Init(root string, config map[string]string) (drivers.Driver, error)

Types

type Device

type Device struct {
	Root              string
	DataDevice        string
	MetadataDevice    string
	ThinpoolDevice    string
	ThinpoolSize      int64
	ThinpoolBlockSize int64
	LastDevID         int
	Volumes           map[string]Volume
}

type Driver

type Driver struct {
	Device
	// contains filtered or unexported fields
}

func (*Driver) CloseSnapshot

func (d *Driver) CloseSnapshot(id, volumeID string) error

func (*Driver) CompareSnapshot

func (d *Driver) CompareSnapshot(id, compareID, volumeID string) (*metadata.Mappings, error)

func (*Driver) CreateSnapshot

func (d *Driver) CreateSnapshot(id, volumeID string) error

func (*Driver) CreateVolume

func (d *Driver) CreateVolume(id, baseID string, size int64) error

func (*Driver) DeleteSnapshot

func (d *Driver) DeleteSnapshot(id, volumeID string) error

func (*Driver) DeleteVolume

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

func (*Driver) GetVolumeDevice

func (d *Driver) GetVolumeDevice(id string) (string, error)

func (*Driver) HasSnapshot

func (d *Driver) HasSnapshot(id, volumeID string) bool

func (*Driver) Info

func (d *Driver) Info() error

func (*Driver) ListVolume

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

func (*Driver) Name

func (d *Driver) Name() string

func (*Driver) OpenSnapshot

func (d *Driver) OpenSnapshot(id, volumeID string) error

func (*Driver) ReadSnapshot

func (d *Driver) ReadSnapshot(id, volumeID string, offset int64, data []byte) error

type Snapshot

type Snapshot struct {
	DevID     int
	Activated bool
}

type Volume

type Volume struct {
	DevID     int
	Size      int64
	Snapshots map[string]Snapshot
}

Jump to

Keyboard shortcuts

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