package rafs

import "github.com/containerd/nydus-snapshotter/pkg/rafs"

Index

Constants

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

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:

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)

Source Files

rafs.go

Version
v0.15.1 (latest)
Published
Jan 26, 2025
Platform
linux/amd64
Imports
8 packages
Last checked
2 weeks ago

Tools for package owners.