rafs

package
v0.13.13 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 6

Documentation

Index

Constants

View Source
const (
	AnnoFsCacheDomainID string = "fscache.domainid"
	AnnoFsCacheID       string = "fscache.id"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}
var RafsGlobalCache Cache

Global cache to hold all RAFS instances.

func NewRafsCache

func NewRafsCache() Cache

func (*Cache) Add

func (rs *Cache) Add(r *Rafs)

func (*Cache) Get

func (rs *Cache) Get(snapshotID string) *Rafs

func (*Cache) Head

func (rs *Cache) Head() *Rafs

func (*Cache) Len

func (rs *Cache) Len() int

func (*Cache) List

func (rs *Cache) List() map[string]*Rafs

func (*Cache) ListLocked

func (rs *Cache) ListLocked() map[string]*Rafs

func (*Cache) Lock

func (rs *Cache) Lock()

func (*Cache) Remove

func (rs *Cache) Remove(snapshotID string)

func (*Cache) SetIntances

func (rs *Cache) SetIntances(instances map[string]*Rafs)

func (*Cache) Unlock

func (rs *Cache) Unlock()

type NewRafsOpt

type NewRafsOpt func(r *Rafs) error

type Rafs

type Rafs struct {
	Seq         uint64
	ImageID     string // Usually is the image reference
	DaemonID    string
	FsDriver    string
	SnapshotID  string // Given by containerd
	SnapshotDir string
	// 1. A host kernel EROFS/TARFS mountpoint
	// 2. Absolute path to each rafs instance root directory.
	Mountpoint  string
	Annotations map[string]string
}

The whole struct will be persisted

func NewRafs

func NewRafs(snapshotID, imageID, fsDriver string) (*Rafs, error)

func (*Rafs) AddAnnotation

func (r *Rafs) AddAnnotation(k, v string)

func (*Rafs) BootstrapFile

func (r *Rafs) BootstrapFile() (string, error)

func (*Rafs) FscacheWorkDir

func (r *Rafs) FscacheWorkDir() string

Blob caches' chunk bitmap and meta headers are stored here.

func (*Rafs) GetFsDriver

func (r *Rafs) GetFsDriver() string

func (*Rafs) GetMountpoint

func (r *Rafs) GetMountpoint() string

Get top level mount point for the RAFS instance:

  • FUSE with dedicated mode: the FUSE filesystem mount point, the RAFS filesystem is directly mounted at the mount point.
  • FUSE with shared mode: the FUSE filesystem mount point, the RAFS filesystem is mounted at a subdirectory under the mount point.
  • EROFS/fscache: the EROFS filesystem mount point.

func (*Rafs) GetSnapshotDir

func (r *Rafs) GetSnapshotDir() string

func (*Rafs) RelaMountpoint

func (r *Rafs) RelaMountpoint() string

Get the sub-directory under a FUSE mount point to mount a RAFS instance. For a nydusd daemon in shared mode, one or more RAFS filesystem instances can be mounted to sub-directories of the FUSE filesystem. This method returns the subdirectory for a RAFS filesystem instance.

func (*Rafs) SetMountpoint

func (r *Rafs) SetMountpoint(mp string)

Jump to

Keyboard shortcuts

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