lower

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 28 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

View Source
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.

func UpperBase

func UpperBase(c *store.Cache, root gitpack.SHA) upperdir.BaseTree

UpperBase returns the base tree of a mount for upperdir.Scan. A submodule is a directory with no entries.

Types

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
	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 MountOpts

type MountOpts struct {
	TTL               time.Duration
	Debug             bool
	DefaultPermission bool
	DirectMount       bool
}

type Node

type Node struct {
	fs.Inode
	// contains filtered or unexported fields
}

func (*Node) Allocate

func (n *Node) Allocate(ctx context.Context, f fs.FileHandle, off uint64, size uint64, mode uint32) syscall.Errno

func (*Node) Create

func (n *Node) Create(ctx context.Context, name string, flags uint32, mode uint32, out *fuse.EntryOut) (*fs.Inode, fs.FileHandle, uint32, syscall.Errno)

func (*Node) Fsync

func (n *Node) Fsync(ctx context.Context, f fs.FileHandle, flags uint32) syscall.Errno

Fsync succeeds: the lower layer holds nothing dirty.

func (*Node) Getattr

func (n *Node) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) (rerr syscall.Errno)

func (*Node) Lookup

func (n *Node) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (_ *fs.Inode, rerr syscall.Errno)

func (*Node) Mkdir

func (n *Node) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)

func (*Node) Open

func (n *Node) Open(ctx context.Context, flags uint32) (_ fs.FileHandle, _ uint32, rerr syscall.Errno)

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).

func (*Node) Readdir

func (n *Node) Readdir(ctx context.Context) (_ fs.DirStream, rerr syscall.Errno)
func (n *Node) Readlink(ctx context.Context) (_ []byte, rerr syscall.Errno)

func (*Node) Rename

func (n *Node) Rename(ctx context.Context, name string, newParent fs.InodeEmbedder, newName string, flags uint32) syscall.Errno

func (*Node) Rmdir

func (n *Node) Rmdir(ctx context.Context, name string) syscall.Errno

func (*Node) Setattr

func (n *Node) Setattr(ctx context.Context, f fs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno

func (*Node) Statfs

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 (*Node) Write

func (n *Node) Write(ctx context.Context, f fs.FileHandle, data []byte, off int64) (uint32, syscall.Errno)

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

func New(ctx context.Context, cfg Config) (*VFS, error)

New opens the workspace of cfg.Base: it reads the commit and its root tree. It runs under the span vfs.open.

func (*VFS) BaseTree

func (v *VFS) BaseTree() string

BaseTree is the root tree of the mount commit.

func (*VFS) Cache

func (v *VFS) Cache() *store.Cache

Cache is the node cache of the mount.

func (*VFS) Changes

func (v *VFS) Changes(ctx context.Context) ([]ctl.ChangeEntry, upperdir.Token, error)

Changes lists the files of the upper directory that differ from the base tree.

func (*VFS) Close

func (v *VFS) Close()

Close writes the last vfs.stats record. The upper directory stays on disk.

func (*VFS) Dirty

func (v *VFS) Dirty(ctx context.Context) ([]ctl.DirtyEntry, upperdir.Token, error)

Dirty is the dirty set of the upper directory against the base tree.

func (*VFS) MountFUSE

func (v *VFS) MountFUSE(ctx context.Context, mnt string, o MountOpts) (*fuse.Server, error)

MountFUSE mounts v at mnt through the host kernel FUSE.

func (*VFS) Root

func (v *VFS) Root() *Node

func (*VFS) Stats

func (v *VFS) Stats() ctl.Stats

Stats returns the counters of the node cache.

func (*VFS) Token

func (v *VFS) Token() (upperdir.Token, error)

Token is the change token of the upper directory.

Jump to

Keyboard shortcuts

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