Documentation ¶
Index ¶
- Variables
- func AttachLoopDevice(filename string) (*os.File, error)
- func DevmapperLogCallback(level C.int, file *C.char, line C.int, dm_errno_or_class C.int, ...)
- func GetBlockDeviceSize(file *os.File) (uint64, error)
- func GetLibraryVersion() (string, error)
- func LogInitVerbose(level int)
- func RemoveDevice(name string) error
- func SetDevDir(dir string) error
- func UdevWait(cookie uint32) error
- type AddNodeType
- type DevInfo
- type DeviceSet
- func (devices *DeviceSet) AddDevice(hash, baseHash string) error
- func (devices *DeviceSet) HasActivatedDevice(hash string) bool
- func (devices *DeviceSet) HasDevice(hash string) bool
- func (devices *DeviceSet) HasInitializedDevice(hash string) bool
- func (devices *DeviceSet) MountDevice(hash, path string, readOnly bool) error
- func (devices *DeviceSet) RemoveDevice(hash string) error
- func (devices *DeviceSet) SetInitialized(hash string) error
- func (devices *DeviceSet) Shutdown() error
- func (devices *DeviceSet) Status() *Status
- func (devices *DeviceSet) UnmountDevice(hash, path string, deactivate bool) error
- type DevmapperLogger
- type DiskUsage
- type Info
- type MetaData
- type Status
- type Task
- func (t *Task) AddTarget(start uint64, size uint64, ttype string, params string) error
- func (t *Task) GetDriverVersion() (string, error)
- func (t *Task) GetInfo() (*Info, error)
- func (t *Task) GetNextTarget(next uintptr) (uintptr, uint64, uint64, string, string)
- func (t *Task) Run() error
- func (t *Task) SetAddNode(add_node AddNodeType) error
- func (t *Task) SetCookie(cookie *uint32, flags uint16) error
- func (t *Task) SetMessage(message string) error
- func (t *Task) SetName(name string) error
- func (t *Task) SetRo() error
- func (t *Task) SetSector(sector uint64) error
- type TaskType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultDataLoopbackSize int64 = 100 * 1024 * 1024 * 1024 DefaultMetaDataLoopbackSize int64 = 2 * 1024 * 1024 * 1024 DefaultBaseFsSize uint64 = 10 * 1024 * 1024 * 1024 )
View Source
var ( ErrTaskRun = errors.New("dm_task_run failed") ErrTaskSetName = errors.New("dm_task_set_name failed") ErrTaskSetMessage = errors.New("dm_task_set_message failed") ErrTaskSetAddNode = errors.New("dm_task_set_add_node failed") ErrTaskSetRO = errors.New("dm_task_set_ro failed") ErrTaskAddTarget = errors.New("dm_task_add_target failed") ErrGetDriverVersion = errors.New("dm_task_get_driver_version failed") ErrAttachLoopbackDevice = errors.New("loopback mounting failed") ErrGetBlockSize = errors.New("Can't get block size") ErrUdevWait = errors.New("wait on udev cookie failed") ErrSetDevDir = errors.New("dm_set_dev_dir failed") ErrGetLibraryVersion = errors.New("dm_get_library_version failed") ErrCreateRemoveTask = errors.New("Can't create task of type DeviceRemove") ErrRunRemoveDevice = errors.New("running removeDevice failed") )
Functions ¶
func DevmapperLogCallback ¶
func GetLibraryVersion ¶
func LogInitVerbose ¶
func LogInitVerbose(level int)
Types ¶
type AddNodeType ¶
type AddNodeType int
const ( AddNodeOnResume AddNodeType = iota AddNodeOnCreate )
type DevInfo ¶
type DeviceSet ¶
type DeviceSet struct { MetaData sync.Mutex TransactionId uint64 NewTransactionId uint64 // contains filtered or unexported fields }
func NewDeviceSet ¶
func (*DeviceSet) HasActivatedDevice ¶
func (*DeviceSet) HasInitializedDevice ¶
func (*DeviceSet) MountDevice ¶
func (*DeviceSet) RemoveDevice ¶
func (*DeviceSet) SetInitialized ¶
type DevmapperLogger ¶
type DevmapperLogger interface {
// contains filtered or unexported methods
}
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
func TaskCreate ¶
func (*Task) GetDriverVersion ¶
func (*Task) GetNextTarget ¶
func (*Task) SetAddNode ¶
func (t *Task) SetAddNode(add_node AddNodeType) error
func (*Task) SetMessage ¶
Click to show internal directories.
Click to hide internal directories.