pmdmanager

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearDevice

func ClearDevice(device PmemDeviceInfo, flush bool) error

func FlushDevice

func FlushDevice(dev PmemDeviceInfo, blocks uint64) error

func WaitDeviceAppears added in v0.5.5

func WaitDeviceAppears(dev PmemDeviceInfo) error

Types

type PmemDeviceInfo

type PmemDeviceInfo struct {
	//Name name of the block device
	Name string
	//Path actual device path
	Path string
	//Size size allocated for block device
	Size uint64
}

PmemDeviceInfo represents a block device

type PmemDeviceManager

type PmemDeviceManager interface {
	//GetCapacity returns the available maximum capacity that can be assigned to a Device/Volume
	GetCapacity() (map[string]uint64, error)

	//CreateDevice creates a new block device with give name, size and namespace mode
	CreateDevice(name string, size uint64, nsmode string) error

	//GetDevice returns the block device information for given name
	GetDevice(name string) (PmemDeviceInfo, error)

	//DeleteDevice deletes an existing block device with give name.
	// If 'flush' is 'true', then the device data is zerod beofore deleting the device
	DeleteDevice(name string, flush bool) error

	//FlushDeviceData zeros all blocks in the blocke device with given name
	FlushDeviceData(name string) error

	//ListDevices returns all the block devices information that was created by this device manager
	ListDevices() ([]PmemDeviceInfo, error)
}

PmemDeviceManager interface to manage the PMEM block devices

func NewPmemDeviceManagerLVM

func NewPmemDeviceManagerLVM() (PmemDeviceManager, error)

NewPmemDeviceManagerLVM Instantiates a new LVM based pmem device manager The pre-requisite for this manager is that all the pmem regions which should be managed by this LMV manager are devided into namespaces and grouped as volume groups.

func NewPmemDeviceManagerNdctl

func NewPmemDeviceManagerNdctl() (PmemDeviceManager, error)

NewPmemDeviceManagerNdctl Instantiates a new ndctl based pmem device manager

Jump to

Keyboard shortcuts

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