reflink

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package reflink checks whether a directory is on a filesystem that can clone files with the FICLONE ioctl. The provisioner uses it to verify a state directory and the daemon uses it to probe the host at start.

Index

Constants

View Source
const (
	FilesystemXFS   = "xfs"
	FilesystemBtrfs = "btrfs"
	FilesystemExt4  = "ext4"
	FilesystemTmpfs = "tmpfs"
	// FilesystemOverlay is overlayfs. A container root is usually on it.
	FilesystemOverlay = "overlay"
)

Filesystem names returned by FilesystemType for the types the provisioner cares about.

Variables

View Source
var ErrNotSupported = errors.New("filesystem does not support reflink (FICLONE)")

ErrNotSupported is returned by Probe when the filesystem under the directory does not support FICLONE.

Functions

func FilesystemType

func FilesystemType(path string) (string, error)

FilesystemType returns the name of the filesystem that holds path, such as "xfs" or "btrfs". Types the package does not know are returned as their statfs magic number in hex.

func Probe

func Probe(dir string) error

Probe creates a small file in dir, clones it to a second file with FICLONE and removes both. It returns nil when the clone succeeds and an error wrapping ErrNotSupported when the filesystem refuses the ioctl.

Types

This section is empty.

Jump to

Keyboard shortcuts

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