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 ¶
- func New(ctx context.Context, vfsObj *vfs.VirtualFilesystem, fsname string, ...) (*vfs.FileDescription, error)
- type FSParameter
- type FSValue
- type FSValueBlob
- type FSValueFd
- type FSValueFlag
- type FSValuePath
- type FSValueString
- type Fd
- func (fd *Fd) DoCmdCreate(ctx context.Context, vfsObj *vfs.VirtualFilesystem) error
- func (fd *Fd) DoCmdReconfigure(ctx context.Context, vfsObj *vfs.VirtualFilesystem) error
- func (fd *Fd) GetFilesystem() (*vfs.Filesystem, *vfs.Dentry, *vfs.MountOptions, error)
- func (fd *Fd) Release(ctx context.Context)
- func (fd *Fd) SetParam(key string, param FSParameter) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FSParameter ¶
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 ¶
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 ¶
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.