Documentation ¶
Overview ¶
Package device
Index ¶
Constants ¶
View Source
const ( // general constants NameSize = 64 KeySize = 32 Major = 7 // paths LoopControlPath = "/dev/loop-control" // DeviceFormatString holds the format of loopback devices DeviceFormatString = "/dev/loop%d" // ioctl commands SetFd = 0x4C00 ClrFd = 0x4C01 SetStatus64 = 0x4C04 CtlAdd = 0x4C80 CtlRemove = 0x4C81 CtlGetFree = 0x4C82 )
Variables ¶
This section is empty.
Functions ¶
func GetLoopDeviceMap ¶
Types ¶
type Device ¶
Device represents a loop device /dev/loop#
func Attach ¶
Attach attaches backingFile to the loopback device starting at offset. If ro is true, then the file is attached read only.
func GetFree ¶
GetFree searches for the first free loopback device. If it cannot find one, it will attempt to create one. If anything fails, GetFree will return an error.
type Info ¶
type Info struct { Device uint64 INode uint64 RDevice uint64 Offset uint64 SizeLimit uint64 Number uint32 EncryptType uint32 EncryptKeySize uint32 Flags uint32 FileName [NameSize]byte CryptName [NameSize]byte EncryptKey [KeySize]byte Init [2]uint64 }
Info is a datastructure that holds relevant information about a file backed loopback device.
Click to show internal directories.
Click to hide internal directories.