blockdevice

package
v0.0.0-...-932836e Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadWriterAt

type ReadWriterAt interface {
	io.ReaderAt
	io.WriterAt
}

ReadWriterAt is an interface for reading from/writing to a byte slice like data source (e.g., a file or disk).

func MemoryMapBlockDevice

func MemoryMapBlockDevice(path string) (ReadWriterAt, int, int64, error)

MemoryMapBlockDevice maps the entire contents of a block device into the address space of the current process. Access to the memory map is provided in the form of an io.ReaderAt/io.WriterAt.

The sector size of the block device and the total number of sectors are also returned. It may be assumed that these remain constant over the lifetime of the block device and process.

Writes may only occur at sector boundaries, as unaligned writes would cause unnecessary read operations against underlying storage.

Jump to

Keyboard shortcuts

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