Documentation
¶
Overview ¶
Package lower is a lazy read-only file system over one commit of the version control store: the lower layer of a kernel overlay, with the dirty set read from the upper directory. The FUSE server builds on Linux only.
Package vfs is the node-local lazy workspace: a git tree served over FUSE as the read-only lower layer of a kernel overlay.
Index ¶
- Variables
- func DirtyFromUpper(es []upperdir.Entry) []ctl.DirtyEntry
- func UpperBase(c *store.Cache, root gitpack.SHA) upperdir.BaseTree
- type BaseFile
- type BaseNode
- type Config
- type MountOpts
- type Node
- func (n *Node) Allocate(ctx context.Context, f fs.FileHandle, off uint64, size uint64, mode uint32) syscall.Errno
- func (n *Node) Create(ctx context.Context, name string, flags uint32, mode uint32, ...) (*fs.Inode, fs.FileHandle, uint32, syscall.Errno)
- func (n *Node) Fsync(ctx context.Context, f fs.FileHandle, flags uint32) syscall.Errno
- func (n *Node) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) (rerr syscall.Errno)
- func (n *Node) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (_ *fs.Inode, rerr syscall.Errno)
- func (n *Node) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (n *Node) Open(ctx context.Context, flags uint32) (_ fs.FileHandle, _ uint32, rerr syscall.Errno)
- func (n *Node) Read(ctx context.Context, f fs.FileHandle, dest []byte, off int64) (res fuse.ReadResult, rerr syscall.Errno)
- func (n *Node) Readdir(ctx context.Context) (_ fs.DirStream, rerr syscall.Errno)
- func (n *Node) Readlink(ctx context.Context) (_ []byte, rerr syscall.Errno)
- func (n *Node) Rename(ctx context.Context, name string, newParent fs.InodeEmbedder, newName string, ...) syscall.Errno
- func (n *Node) Rmdir(ctx context.Context, name string) syscall.Errno
- func (n *Node) Setattr(ctx context.Context, f fs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
- func (n *Node) Statfs(ctx context.Context, out *fuse.StatfsOut) (rerr syscall.Errno)
- func (n *Node) Symlink(ctx context.Context, target, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (n *Node) Unlink(ctx context.Context, name string) syscall.Errno
- func (n *Node) Write(ctx context.Context, f fs.FileHandle, data []byte, off int64) (uint32, syscall.Errno)
- type Publication
- type VFS
- func (v *VFS) BaseChild(ctx context.Context, dir BaseNode, name string) (BaseNode, error)
- func (v *VFS) BaseChildren(ctx context.Context, dir BaseNode) ([]BaseNode, error)
- func (v *VFS) BaseOpen(ctx context.Context, n BaseNode) (*BaseFile, error)
- func (v *VFS) BaseReadLink(ctx context.Context, n BaseNode) ([]byte, error)
- func (v *VFS) BaseResolve(ctx context.Context, p string) (BaseNode, error)
- func (v *VFS) BaseRoot() BaseNode
- func (v *VFS) BaseTree() string
- func (v *VFS) Cache() *store.Cache
- func (v *VFS) CallStats() *tel.CallStats
- func (v *VFS) Changes(ctx context.Context) ([]ctl.ChangeEntry, ctl.Token, error)
- func (v *VFS) ChangesOf(ctx context.Context, es []upperdir.Entry, fsys upperdir.FS) ([]ctl.ChangeEntry, error)
- func (v *VFS) Close()
- func (v *VFS) Dirty(ctx context.Context) ([]ctl.DirtyEntry, ctl.Token, error)
- func (v *VFS) MountFUSE(ctx context.Context, mnt string, o MountOpts) (*fuse.Server, error)
- func (v *VFS) ReadFile(ctx context.Context, name string) ([]byte, error)
- func (v *VFS) Root() *Node
- func (v *VFS) Stats() ctl.Stats
- func (v *VFS) Time() time.Time
- func (v *VFS) Token() (ctl.Token, error)
- func (v *VFS) UpperBase() upperdir.BaseTree
Constants ¶
This section is empty.
Variables ¶
var ErrNoUpper = errors.New("vfs: a mount of a tree has no upper directory")
ErrNoUpper is the answer of a dirty set or change token of a mount of a tree, which has no upper directory.
var ParsePublication = volattr.ParsePublication
Functions ¶
func DirtyFromUpper ¶
func DirtyFromUpper(es []upperdir.Entry) []ctl.DirtyEntry
DirtyFromUpper converts the entries of upperdir.Scan to the entries of the dirty op.
Types ¶
type BaseFile ¶ added in v0.40.0
type BaseFile struct {
// contains filtered or unexported fields
}
BaseFile is the open blob of a base file.
type BaseNode ¶ added in v0.40.0
type BaseNode struct {
// contains filtered or unexported fields
}
BaseNode is an entry of the base tree that a lookup found. A directory holds its decoded tree, so a later read goes through the node and never resolves its path again.
type Config ¶
type Config struct {
Store store.Store
CacheDir string
// UpperDir is the upper directory of the kernel overlay over the mount. The daemon reads the dirty set there.
UpperDir string
Base gitpack.SHA // commit
Tree gitpack.SHA
TreeTime time.Time
UID, GID uint32
Cache *store.Cache
NoOpen bool
// Clock paces the stats record and the settle test of the upper directory walk. Nil is the real clock.
Clock clock.Clock
Telemetry tel.Telemetry
// UpperFS reads the upper directory. Nil reads UpperDir from the file system.
UpperFS upperdir.FS
}
Config is what the daemon needs to serve one commit.
type Node ¶
func (*Node) Read ¶
func (n *Node) Read(ctx context.Context, f fs.FileHandle, dest []byte, off int64) (res fuse.ReadResult, rerr syscall.Errno)
Read serves handle-less reads when the kernel runs without OPEN (no_open).
type Publication ¶
type Publication = volattr.Publication
Publication and ParsePublication are the volume attributes of a workspace, shared with the sandbox driver.
type VFS ¶
type VFS struct {
// contains filtered or unexported fields
}
func New ¶
New opens the workspace of cfg.Base: it reads the commit and its root tree. It runs under the span vfs.open.
func (*VFS) BaseChild ¶ added in v0.40.0
BaseChild finds the entry name of a base directory without loading the tree of a child directory. A missing name answers fs.ErrNotExist.
func (*VFS) BaseChildren ¶ added in v0.40.0
BaseChildren lists the entries of a base directory in tree order. A listed directory loads its own tree only when it is looked up or listed.
func (*VFS) BaseOpen ¶ added in v0.40.0
BaseOpen opens the blob of a file or symlink. The cache fetches it with the size and hash check of its name.
func (*VFS) BaseReadLink ¶ added in v0.40.0
BaseReadLink returns the target of a base symlink.
func (*VFS) BaseResolve ¶ added in v0.40.0
BaseResolve finds the node at a base path without loading the tree of a directory at the path. A record of the upper store names its origin this way, and the base tree never changes, so the path always names the same node.
func (*VFS) CallStats ¶ added in v0.17.0
CallStats is the recorder of the control calls and of the store calls that they make.
func (*VFS) Changes ¶
Changes lists the files of the upper directory that differ from the base tree.
func (*VFS) ChangesOf ¶ added in v0.40.0
func (v *VFS) ChangesOf(ctx context.Context, es []upperdir.Entry, fsys upperdir.FS) ([]ctl.ChangeEntry, error)
ChangesOf lists the files of the dirty entries es that differ from the base tree, with the blob that the upper directory fsys holds for each.
func (*VFS) Close ¶
func (v *VFS) Close()
Close writes the last vfs.stats record. The upper directory stays on disk.
func (*VFS) ReadFile ¶ added in v0.40.0
ReadFile reads a regular file of the base tree, or answers fs.ErrNotExist.