loopback

package
v0.0.0-...-f0373c1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoopSetFd       = unix.LOOP_SET_FD
	LoopCtlGetFree  = unix.LOOP_CTL_GET_FREE
	LoopGetStatus64 = unix.LOOP_GET_STATUS64
	LoopSetStatus64 = unix.LOOP_SET_STATUS64
	LoopClrFd       = unix.LOOP_CLR_FD
	LoopSetCapacity = unix.LOOP_SET_CAPACITY
)

IOCTL consts

View Source
const (
	LoFlagsAutoClear = unix.LO_FLAGS_AUTOCLEAR
	LoFlagsReadOnly  = unix.LO_FLAGS_READ_ONLY
	LoFlagsPartScan  = unix.LO_FLAGS_PARTSCAN
	LoKeySize        = unix.LO_KEY_SIZE
	LoNameSize       = unix.LO_NAME_SIZE
)

LOOP consts.

Variables

View Source
var (
	ErrAttachLoopbackDevice   = errors.New("loopback attach failed")
	ErrGetLoopbackBackingFile = errors.New("Unable to get loopback backing file")
	ErrSetCapacity            = errors.New("Unable set loopback capacity")
)

Loopback related errors

Functions

func AttachLoopDevice

func AttachLoopDevice(sparseName string) (loop *os.File, err error)

AttachLoopDevice attaches the given sparse file to the next available loopback device. It returns an opened *os.File.

func FindLoopDeviceFor

func FindLoopDeviceFor(file *os.File) *os.File

FindLoopDeviceFor returns a loopback device file for the specified file which is backing file of a loop back device.

func SetCapacity

func SetCapacity(file *os.File) error

SetCapacity reloads the size for the loopback device.

Types

This section is empty.

Jump to

Keyboard shortcuts

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