Documentation
¶
Overview ¶
package devicemapper is a thin wrapper for the devicemapper ioctl API. See: https://github.com/torvalds/linux/blob/master/include/uapi/linux/dm-ioctl.h
Index ¶
- Constants
- func CreateActiveDevice(name string, readOnly bool, targets []Target) (uint64, error)
- func CreateDevice(name string) (uint64, error)
- func LoadTable(name string, readOnly bool, targets []Target) error
- func RemoveDevice(name string) error
- func Resume(name string) error
- func Suspend(name string) error
- type DMIoctl
- type DMNameList
- type DMTargetDeps
- type DMTargetMessage
- type DMTargetSpec
- type DMTargetVersions
- type Target
- type Version
Constants ¶
View Source
const ( /* Top level cmds */ DM_VERSION_CMD uintptr = (0xc138fd << 8) + iota DM_REMOVE_ALL_CMD DM_LIST_DEVICES_CMD /* device level cmds */ DM_DEV_CREATE_CMD DM_DEV_REMOVE_CMD DM_DEV_RENAME_CMD DM_DEV_SUSPEND_CMD DM_DEV_STATUS_CMD DM_DEV_WAIT_CMD /* Table level cmds */ DM_TABLE_LOAD_CMD DM_TABLE_CLEAR_CMD DM_TABLE_DEPS_CMD DM_TABLE_STATUS_CMD /* Added later */ DM_LIST_VERSIONS_CMD DM_TARGET_MSG_CMD DM_DEV_SET_GEOMETRY_CMD DM_DEV_ARM_POLL_CMD )
View Source
const ( DM_READONLY_FLAG = 1 << 0 /* In/Out */ DM_SUSPEND_FLAG = 1 << 1 /* In/Out */ DM_PERSISTENT_DEV_FLAG = 1 << 3 /* In */ )
Variables ¶
This section is empty.
Functions ¶
func CreateActiveDevice ¶
func CreateDevice ¶
func RemoveDevice ¶
Types ¶
type DMNameList ¶
type DMTargetDeps ¶
type DMTargetMessage ¶
type DMTargetSpec ¶
type DMTargetVersions ¶
type Target ¶
type Target struct {
// StartSector is the first sector (defined as being 512 bytes long) this
// target covers.
StartSector uint64
// Length is the number of sectors (defined as being 512 bytes long) this
// target covers, starting from StartSector.
Length uint64
// Type is the type of target handling this byte region.
// Types implemented by the Linux kernel can be found at
// @linux//drivers/md/... by looking for dm_register_target() calls.
Type string
// Parameters are additional parameters specific to the target type.
// Note that null bytes and parameters consisting only of whitespace
// characters cannot be encoded and will return an error.
Parameters []string
}
Target represents a byte region inside a devicemapper table for a given device provided by a given target implementation.
Click to show internal directories.
Click to hide internal directories.