driverd

package
v0.0.0-...-604d1d5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCapacity = 1 << 20
)

Variables

This section is empty.

Functions

func NewControllerServer

func NewControllerServer(lvmctrld pb.LvmCtrldClient, volumeLock VolumeLocker, diskRpc diskrpc.DiskRpc, defaultFs string) (*controllerServer, error)

func NewFileSystemRegistry

func NewFileSystemRegistry() (*fileSystemRegistry, error)

func NewIdentityServer

func NewIdentityServer(drvName, version string) (*identityServer, error)

func NewNodeServer

func NewNodeServer(lvmctrld pb.LvmCtrldClient, volumeLock VolumeLocker, fsRegistry FileSystemRegistry) (*nodeServer, error)

Types

type DiskRpcService

type DiskRpcService struct {
	diskrpc.DiskRpc
	// contains filtered or unexported fields
}

DiskRpcService adapts DiskRpc to use volume locking.

func NewDiskRpcService

func NewDiskRpcService(lvmctrld pb.LvmCtrldClient, locker VolumeLocker) (*DiskRpcService, error)

func (*DiskRpcService) Start

func (s *DiskRpcService) Start() error

type FileSystem

type FileSystem interface {
	Accepts(accessType VolumeAccessType) bool
	Make(device string) error
	Grow(device string) error
	Mount(source, mountPoint string, flags []string) error
	Umount(mountPoint string) error
}

func NewFileSystem

func NewFileSystem(fs string) (FileSystem, error)

type FileSystemRegistry

type FileSystemRegistry interface {
	GetFileSystem(filesystem string) (FileSystem, error)
}

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

func NewListener

func NewListener(addr string, is *identityServer, ns *nodeServer, cs *controllerServer) (*Listener, error)

func (*Listener) Run

func (l *Listener) Run() error

type LogVolType

type LogVolType string
const (
	VolumeVolType    LogVolType = "volume"
	SnapshotVolType  LogVolType = "snapshot"
	TemporaryVolType LogVolType = "temp"
)

type LvmCtrldClientConnection

type LvmCtrldClientConnection struct {
	pb.LvmCtrldClient
	// contains filtered or unexported fields
}

func NewLvmCtrldClient

func NewLvmCtrldClient(address string) (*LvmCtrldClientConnection, error)

func (*LvmCtrldClientConnection) Close

func (c *LvmCtrldClientConnection) Close() error

func (*LvmCtrldClientConnection) Wait

func (c *LvmCtrldClientConnection) Wait() error

type RpcRole

type RpcRole string

type TagKey

type TagKey string

type VolumeAccessType

type VolumeAccessType int
const (
	MountAccessType VolumeAccessType = iota
	BlockAccessType

	BlockAccessFsName = "$raw" // the $ prefix is to avoid colliding with a real filesystem name.
)

type VolumeInfo

type VolumeInfo struct {
	VolumeRef
	*pb.LogicalVolume
}

A type that holds details of a volume by wrapping a LogicalVolume.

func NewVolumeInfoFromLv

func NewVolumeInfoFromLv(lv *pb.LogicalVolume) *VolumeInfo

func (*VolumeInfo) OriginRef

func (v *VolumeInfo) OriginRef() *VolumeRef

func (*VolumeInfo) String

func (v *VolumeInfo) String() string

func (*VolumeInfo) Tags

func (v *VolumeInfo) Tags() (map[TagKey]string, error)

type VolumeLocker

type VolumeLocker interface {
	// Lock the given volume for the given operation.
	//
	// Volume locks are reentrant per volume (but not per <volume, op> pairs),
	// that is one can lock the same volume with multiple ops.
	LockVolume(ctx context.Context, vol VolumeRef, op string) error

	// Unlock a volume for a given <vol, op> pair.
	UnlockVolume(ctx context.Context, vol VolumeRef, op string) error

	// Retrieve the owner mailbox and name for a volume, if any.
	GetOwner(ctx context.Context, ref VolumeRef) (diskrpc.MailBoxID, string, error)
}

func NewVolumeLocker

func NewVolumeLocker(lvmctrld pb.LvmCtrldClient, nodeName string) (VolumeLocker, error)

type VolumeRef

type VolumeRef struct {
	LvName string
	VgName string
}

A type that holds a volume reference. Only the VgName and LvName fields are expected to be set.

func NewVolumeRefFromID

func NewVolumeRefFromID(volumeID string) (*VolumeRef, error)

func NewVolumeRefFromLv

func NewVolumeRefFromLv(lv *pb.LogicalVolume) *VolumeRef

func NewVolumeRefFromVgTypeName

func NewVolumeRefFromVgTypeName(vg string, t LogVolType, name string) *VolumeRef

func (*VolumeRef) DevPath

func (v *VolumeRef) DevPath() string

func (*VolumeRef) ID

func (v *VolumeRef) ID() string

func (*VolumeRef) Lv

func (v *VolumeRef) Lv() string

func (*VolumeRef) String

func (v *VolumeRef) String() string

func (*VolumeRef) Vg

func (v *VolumeRef) Vg() string

func (*VolumeRef) VgLv

func (v *VolumeRef) VgLv() string

Jump to

Keyboard shortcuts

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