gofer

package
v0.0.0-...-ff2c174 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: Apache-2.0, MIT Imports: 34 Imported by: 0

Documentation

Overview

Package gofer implements a remote 9p filesystem.

Index

Constants

View Source
const FilesystemName = "9p"

FilesystemName is the name under which the filesystem is registered. The name matches fs/9p/vfs_super.c:v9fs_fs_type.name.

Variables

View Source
var (
	// ErrNoTransport is returned when there is no 'trans' option.
	ErrNoTransport = errors.New("missing required option: 'trans='")

	// ErrFileNoReadFD is returned when there is no 'rfdno' option.
	ErrFileNoReadFD = errors.New("missing required option: 'rfdno='")

	// ErrFileNoWriteFD is returned when there is no 'wfdno' option.
	ErrFileNoWriteFD = errors.New("missing required option: 'wfdno='")
)
View Source
var DefaultDirentCacheSize uint64 = fs.DefaultDirentCacheSize

DefaultDirentCacheSize is the default dirent cache size for 9P mounts. It can be adjusted independently from the other dirent caches.

Functions

func NewFile

func NewFile(ctx context.Context, dirent *fs.Dirent, name string, flags fs.FileFlags, i *inodeOperations, handles *handles) *fs.File

NewFile returns a file. NewFile is not appropriate with host pipes and sockets.

The `name` argument is only used to log a warning if we are returning a writeable+executable file. (A metric counter is incremented in this case as well.) Note that we cannot call d.BaseName() directly in this function, because that would lead to a lock order violation, since this is called in d.Create which holds d.mu, while d.BaseName() takes d.parent.mu, and the two locks must be taken in the opposite order.

func Root

func Root(ctx context.Context, dev string, filesystem fs.Filesystem, superBlockFlags fs.MountSourceFlags, o opts) (*fs.Inode, error)

Root returns the root of a 9p mount. This mount is bound to a 9p server based on conn. Otherwise configuration parameters are:

* dev: connection id * filesystem: the filesystem backing the mount * superBlockFlags: the mount flags describing general mount options * opts: parsed 9p mount options

Types

This section is empty.

Jump to

Keyboard shortcuts

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