Documentation ¶
Index ¶
Constants ¶
View Source
const ( // general constants NameSize = 64 KeySize = 32 Major = 7 // paths LoopControlPath = "/dev/loop-control" // loop flags FlagsReadOnly = 1 FlagsAutoClear = 4 FlagsPartScan = 8 FlagsDirectIO = 16 // loop filter types CryptNone = 0 CryptXor = 1 CryptDes = 2 CryptFish2 = 3 CryptBlow = 4 CryptCast128 = 5 CryptIdea = 6 CryptDummy = 9 CryptSkipjack = 10 CryptCryptoApi = 18 MaxCrypt = 20 // ioctl commands SetFd = 0x4C00 ClrFd = 0x4C01 SetStatus = 0x4C02 GetStatus = 0x4C03 SetStatus64 = 0x4C04 GetStatus64 = 0x4C05 ChangeFd = 0x4C06 SetCapacity = 0x4C07 SetDirectIO = 0x4C08 CtlAdd = 0x4C80 CtlRemove = 0x4C81 CtlGetFree = 0x4C82 )
View Source
const DeviceFormatString = "/dev/loop%d"
DeviceFormatString holds the format of loopback devices
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
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.
func New ¶
New creates a reference to a specific loop device, if you know which one you want to reference.
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.