btrfs

package
v0.0.0-...-e66715b Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBtrfsInvalidFilesystem = errors.New("not a btrfs filesystem")
	ErrBtrfsInvalidDriver     = errors.New("invalid driver")
	ErrBtrfsCreatingSubvolume = errors.New("could not create subvolume")
	ErrBtrfsInvalidLabel      = errors.New("invalid label")
	ErrBtrfsListingSnapshots  = errors.New("couldn't list snapshots")
	ErrBtrfsNotSupported      = errors.New("operation not supported on btrfs driver")
)

Functions

func Init

func Init(root string, _ []string) (volume.Driver, error)

Btrfs driver initialization

Types

type BtrfsDFData

type BtrfsDFData struct {
	DataType string
	Level    string
	Total    uint64
	Used     uint64
}

type BtrfsDriver

type BtrfsDriver struct {
	sync.Mutex
	// contains filtered or unexported fields
}

BtrfsDriver is a driver for the btrfs volume

func (*BtrfsDriver) Cleanup

func (d *BtrfsDriver) Cleanup() error

Cleanup implements volume.Driver.Cleanup

func (*BtrfsDriver) Create

func (d *BtrfsDriver) Create(volumeName string) (volume.Volume, error)

Create implements volume.Driver.Create

func (*BtrfsDriver) DriverType

func (d *BtrfsDriver) DriverType() volume.DriverType

DriverType implements volume.Driver.DriverType

func (*BtrfsDriver) Exists

func (d *BtrfsDriver) Exists(volumeName string) bool

Exists implements volume.Driver.Exists

func (*BtrfsDriver) Get

func (d *BtrfsDriver) Get(volumeName string) (volume.Volume, error)

Get implements volume.Driver.Get

func (*BtrfsDriver) GetTenant

func (d *BtrfsDriver) GetTenant(volumeName string) (volume.Volume, error)

GetTenant implements volume.Driver.GetTenant

func (*BtrfsDriver) List

func (d *BtrfsDriver) List() (result []string)

List implements volume.Driver.List

func (*BtrfsDriver) MetadataDir

func (d *BtrfsDriver) MetadataDir() string

MetadataDir returns the path to a volume's metadata directory

func (*BtrfsDriver) Release

func (d *BtrfsDriver) Release(volumeName string) error

Release implements volume.Driver.Release

func (*BtrfsDriver) Remove

func (d *BtrfsDriver) Remove(volumeName string) error

Remove implements volume.Driver.Remove

func (*BtrfsDriver) Resize

func (d *BtrfsDriver) Resize(volumeName string, size uint64) error

Resize implements volume.Driver.Resize. For btrfs it's a noop.

func (*BtrfsDriver) Root

func (d *BtrfsDriver) Root() string

Root implements volume.Driver.Root

func (*BtrfsDriver) Status

func (d *BtrfsDriver) Status() (volume.Status, error)

type BtrfsVolume

type BtrfsVolume struct {
	sync.Mutex
	// contains filtered or unexported fields
}

BtrfsVolume is a btrfs volume

func (*BtrfsVolume) Driver

func (v *BtrfsVolume) Driver() volume.Driver

Driver implements volume.Volume.Driver

func (*BtrfsVolume) Export

func (v *BtrfsVolume) Export(label, parent string, writer io.Writer, excludes []string) error

Export implements volume.Volume.Export

func (*BtrfsVolume) GetSnapshotWithTag

func (v *BtrfsVolume) GetSnapshotWithTag(tagName string) (*volume.SnapshotInfo, error)

GetSnapshotWithTag implements volume.Volume.GetSnapshotWithTag

func (*BtrfsVolume) Import

func (v *BtrfsVolume) Import(label string, reader io.Reader) error

Import implements volume.Volume.Import

func (*BtrfsVolume) Name

func (v *BtrfsVolume) Name() string

Name implements volume.Volume.Name

func (*BtrfsVolume) Path

func (v *BtrfsVolume) Path() string

Path implements volume.Volume.Path

func (*BtrfsVolume) ReadMetadata

func (v *BtrfsVolume) ReadMetadata(label, name string) (io.ReadCloser, error)

ReadMetadata reads the metadata info from a snapshot

func (*BtrfsVolume) RemoveSnapshot

func (v *BtrfsVolume) RemoveSnapshot(label string) error

RemoveSnapshot implements volume.Volume.RemoveSnapshot

func (*BtrfsVolume) Rollback

func (v *BtrfsVolume) Rollback(label string) error

Rollback implements volume.Volume.Rollback

func (*BtrfsVolume) Snapshot

func (v *BtrfsVolume) Snapshot(label, message string, tags []string) error

Snapshot implements volume.Volume.Snapshot

func (*BtrfsVolume) SnapshotInfo

func (v *BtrfsVolume) SnapshotInfo(label string) (*volume.SnapshotInfo, error)

SnapshotInfo returns the meta info for a snapshot

func (*BtrfsVolume) Snapshots

func (v *BtrfsVolume) Snapshots() ([]string, error)

Snapshots implements volume.Volume.Snapshots

func (*BtrfsVolume) TagSnapshot

func (v *BtrfsVolume) TagSnapshot(label string, tagName string) error

TagSnapshot implements volume.Volume.TagSnapshot This is not implemented with btrfs

func (*BtrfsVolume) Tenant

func (v *BtrfsVolume) Tenant() string

Tenant implements volume.Volume.Tenant

func (*BtrfsVolume) UntagSnapshot

func (v *BtrfsVolume) UntagSnapshot(tagName string) (string, error)

UntagSnapshot implements volume.Volume.RemoveSnapshotTag This is not implemented with btrfs

func (*BtrfsVolume) WriteMetadata

func (v *BtrfsVolume) WriteMetadata(label, name string) (io.WriteCloser, error)

WriteMetadata writes the metadata info for a snapshot by writing to the base volume.

Jump to

Keyboard shortcuts

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