overlay

package
v0.0.0-...-957f62e Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0, MIT Imports: 21 Imported by: 0

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

func (*FilesystemOptions) StateFields

func (f *FilesystemOptions) StateFields() []string

func (*FilesystemOptions) StateLoad

func (f *FilesystemOptions) StateLoad(stateSourceObject state.Source)

+checklocksignore

func (*FilesystemOptions) StateSave

func (f *FilesystemOptions) StateSave(stateSinkObject state.Sink)

+checklocksignore

func (*FilesystemOptions) StateTypeName

func (f *FilesystemOptions) StateTypeName() string

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.

func (*FilesystemType) StateFields

func (fstype *FilesystemType) StateFields() []string

func (*FilesystemType) StateLoad

func (fstype *FilesystemType) StateLoad(stateSourceObject state.Source)

+checklocksignore

func (*FilesystemType) StateSave

func (fstype *FilesystemType) StateSave(stateSinkObject state.Sink)

+checklocksignore

func (*FilesystemType) StateTypeName

func (fstype *FilesystemType) StateTypeName() string

Jump to

Keyboard shortcuts

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