metadata

package
v0.0.0-...-6dda9d7 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: BSD-2-Clause-Patent Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FaultUnknown = metadataFault(
		code.ControlMetadataUnknown,
		"unknown control metadata error",
		"",
	)
)

Functions

func FaultBadFilesystem

func FaultBadFilesystem(fs *system.FsType) *fault.Fault

FaultBadFilesystem is an error that can occur if the control metadata path points at a filesystem that cannot be used.

Types

type Provider

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

Provider provides management functionality for metadata storage.

func DefaultProvider

func DefaultProvider(log logging.Logger) *Provider

DefaultProvider creates a Provider with the default data sources.

func NewProvider

func NewProvider(log logging.Logger, sys SystemProvider, mount storage.MountProvider) *Provider

NewProvider creates a Provider with the underlying data sources.

func (*Provider) Format

Format formats the storage used for control metadata, if it is a separate device. If the storage location is on an existing partition, the format of the existing filesystem is checked.

func (*Provider) Mount

Mount mounts the metadata device, if there is one. If an directory is being used instead, this is a no-op.

func (*Provider) NeedsFormat

func (p *Provider) NeedsFormat(req storage.MetadataFormatRequest) (out bool, _ error)

NeedsFormat checks whether the metadata storage needs to be formatted.

func (*Provider) Unmount

Unmount unmounts the metadata device, if there is one. If an directory is being used instead, this is a no-op.

type SystemProvider

type SystemProvider interface {
	Chown(string, int, int) error
	Getfs(device string) (string, error)
	GetfsType(path string) (*system.FsType, error)
	Mkdir(string, os.FileMode) error
	Mkfs(req system.MkfsReq) error
	RemoveAll(string) error
	Stat(string) (os.FileInfo, error)
}

SystemProvider provides operating system capabilities.

Jump to

Keyboard shortcuts

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