Documentation ¶
Index ¶
- Variables
- func FaultBadFilesystem(fs *system.FsType) *fault.Fault
- type Provider
- func (p *Provider) Format(req storage.MetadataFormatRequest) error
- func (p *Provider) Mount(req storage.MetadataMountRequest) (*storage.MountResponse, error)
- func (p *Provider) NeedsFormat(req storage.MetadataFormatRequest) (out bool, _ error)
- func (p *Provider) Unmount(req storage.MetadataMountRequest) (*storage.MountResponse, error)
- type SystemProvider
Constants ¶
This section is empty.
Variables ¶
var ( FaultUnknown = metadataFault( code.ControlMetadataUnknown, "unknown control metadata error", "", ) )
Functions ¶
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider provides management functionality for metadata storage.
func DefaultProvider ¶
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 ¶
func (p *Provider) Format(req storage.MetadataFormatRequest) error
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 ¶
func (p *Provider) Mount(req storage.MetadataMountRequest) (*storage.MountResponse, error)
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 ¶
func (p *Provider) Unmount(req storage.MetadataMountRequest) (*storage.MountResponse, error)
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.