overlay

package
v0.0.0-...-fe9d22f Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0, MIT Imports: 20 Imported by: 2

Documentation

Overview

Package overlay provides an overlay filesystem implementation, which synthesizes a filesystem by composing one or more immutable filesystems ("lower layers") with an optional mutable filesystem ("upper layer").

Lock order:

directoryFD.mu / regularFileFD.mu
	filesystem.renameMu
		dentry.dirMu
	    dentry.copyMu
	      filesystem.devMu
	      *** "memmap.Mappable locks" below this point
	      dentry.mapsMu
	        *** "memmap.Mappable locks taken by Translate" below this point
	        dentry.dataMu

Locking dentry.dirMu in multiple dentries requires that parent dentries are locked before child dentries, and that filesystem.renameMu is locked to stabilize this relationship.

Index

Constants

View Source
const Name = "overlay"

Name is the default filesystem name.

Variables

This section is empty.

Functions

func CreateWhiteout

func CreateWhiteout(ctx context.Context, vfsObj *vfs.VirtualFilesystem, creds *auth.Credentials, pop *vfs.PathOperation) error

CreateWhiteout creates a whiteout at pop. Whiteouts are created with character devices with device ID = 0.

Preconditions: pop's parent directory has been copied up.

Types

type FilesystemOptions

type FilesystemOptions struct {

	// If UpperRoot.Ok(), it is the root of the writable upper layer of the
	// overlay.
	UpperRoot vfs.VirtualDentry

	// LowerRoots contains the roots of the immutable lower layers of the
	// overlay. LowerRoots is immutable.
	LowerRoots []vfs.VirtualDentry
}

FilesystemOptions may be passed as vfs.GetFilesystemOptions.InternalData to FilesystemType.GetFilesystem.

+stateify savable

type FilesystemType

type FilesystemType struct{}

FilesystemType implements vfs.FilesystemType.

+stateify savable

func (FilesystemType) GetFilesystem

func (fstype FilesystemType) GetFilesystem(ctx context.Context, vfsObj *vfs.VirtualFilesystem, creds *auth.Credentials, source string, opts vfs.GetFilesystemOptions) (*vfs.Filesystem, *vfs.Dentry, error)

GetFilesystem implements vfs.FilesystemType.GetFilesystem.

func (FilesystemType) Name

func (FilesystemType) Name() string

Name implements vfs.FilesystemType.Name.

func (FilesystemType) Release

func (FilesystemType) Release(ctx context.Context)

Release implements FilesystemType.Release.

Jump to

Keyboard shortcuts

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