fsconfigfd

package
v0.0.0-...-3f1f8f2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0, BSD-3-Clause, MIT Imports: 8 Imported by: 0

Documentation

Overview

Package fsconfigfd provides an implementation of a *filesystem creation context*, part of the new file-descriptor-based mount API.

Applications can create and mount a filesystem separately from placing it on the real mount tree. An fs context is created using fsopen() and configured with fsconfig(), and a mount file descriptor (fsimpl/mountfd) is created with fsmount().

The implementation is currently a work-in-progress. Currently, the primary differences to the Linux implementation are:

  • Filesystem parameters are parsed (and errors handled) at FSCONFIG_CMD_CREATE time rather than when parameters are set
  • FSCONFIG_CMD_CREATE_EXL and FSCONFIG_CMD_RECONFIGURE are not supported (see sys_mount_fd.go)
  • Only FLAG and STRING arguments are supported

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, vfsObj *vfs.VirtualFilesystem, fsname string, fileFlags uint32) (*vfs.FileDescription, error)

New returns a new filesystem configuration context fd. The context's credentials are saved as they are used for the eventual mount.

Types

type FSParameter

type FSParameter struct {
	Value FSValue
	DirFd int
}

FSParameter (together with a key) represents a parameter passed to the filesystem.

+stateify savable

type FSValue

type FSValue interface {
	// contains filtered or unexported methods
}

FSValue represents the value assigned to a parameter passed to the filesystem. There are 5 valid types: bool, string, []byte, FileDescription, and string (path).

type FSValueBlob

type FSValueBlob []byte

FSValueBlob represents a binary blob value passed to the filesystem.

+stateify savable

type FSValueFd

type FSValueFd struct {
	FileDescription *vfs.FileDescription
}

FSValueFd represents a file descriptor value passed to the filesystem.

+stateify savable

type FSValueFlag

type FSValueFlag struct{}

FSValueFlag represents a binary value passed to the filesystem.

+stateify savable

type FSValuePath

type FSValuePath string

FSValuePath represents a path value passed to the filesystem.

+stateify savable

type FSValueString

type FSValueString string

FSValueString represents a string value passed to the filesystem.

+stateify savable

type Fd

type Fd struct {
	vfs.FileDescriptionDefaultImpl
	vfs.DentryMetadataFileDescriptionImpl
	vfs.NoLockFD
	// contains filtered or unexported fields
}

Fd represents a filesystem configuration context.

+stateify savable

func (*Fd) DoCmdCreate

func (fd *Fd) DoCmdCreate(ctx context.Context, vfsObj *vfs.VirtualFilesystem) error

DoCmdCreate instantiates an instance of the requested filesystem, including permission checks. If filesystem instantiation fails, an error will be returned and the context may be placed in a failed state.

func (*Fd) DoCmdReconfigure

func (fd *Fd) DoCmdReconfigure(ctx context.Context, vfsObj *vfs.VirtualFilesystem) error

DoCmdReconfigure reconfigures the underlying filesystem with the parameters queued up by fsconfig(2), including permission checks. Currently a no-op.

func (*Fd) GetFilesystem

func (fd *Fd) GetFilesystem() (*vfs.Filesystem, *vfs.Dentry, *vfs.MountOptions, error)

GetFilesystem returns the filesystem and transitions the fd into the appropriate state if the fd is in "awaiting-mount" mode. If the fd is not in "awaiting-mount" mode, returns an error.

func (*Fd) Release

func (fd *Fd) Release(ctx context.Context)

Release implements vfs.FileDescriptionImpl.Release.

func (*Fd) SetParam

func (fd *Fd) SetParam(key string, param FSParameter) error

SetParam sets the parameter named key to param.

Jump to

Keyboard shortcuts

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