fuse

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 20 Imported by: ? 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 fuse exports the shared compactfs engine through FUSE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(storage core.Access, mountpoint string, options Options) (*gofuse.Server, error)

Mount exports an existing storage engine. Stop the returned server before closing storage. Diagnostics are an optional, separately owned service.

Types

type Handle

type Handle struct {
	// contains filtered or unexported fields
}

func (*Handle) Flush

func (h *Handle) Flush(ctx context.Context) syscall.Errno

func (*Handle) Fsync

func (h *Handle) Fsync(ctx context.Context, _ uint32) syscall.Errno

func (*Handle) Lseek added in v1.0.3

func (h *Handle) Lseek(ctx context.Context, off uint64, whence uint32) (uint64, syscall.Errno)

Lseek uses the permitted conservative representation: all bytes before EOF are data, including zero-filled gaps, and EOF is the only reported hole. Stat belongs to this open file, so pending writes and unlinked inodes retain their current size without flushing or looking up a pathname.

func (*Handle) Read

func (h *Handle) Read(ctx context.Context, dest []byte, off int64) (gofuse.ReadResult, syscall.Errno)

func (*Handle) Release

func (h *Handle) Release(ctx context.Context) syscall.Errno

func (*Handle) Write

func (h *Handle) Write(ctx context.Context, data []byte, off int64) (uint32, syscall.Errno)

type Node

type Node struct {
	fusefs.Inode
	FS core.Access

	Entry meta.Entry
	// contains filtered or unexported fields
}

Node is one namespace inode. Metadata remains authoritative; the embedded go-fuse inode only holds kernel-side references and children.

func (*Node) Create

func (n *Node) Create(ctx context.Context, name string, _ uint32, mode uint32, out *gofuse.EntryOut) (*fusefs.Inode, fusefs.FileHandle, uint32, syscall.Errno)

func (*Node) Getattr

func (n *Node) Getattr(ctx context.Context, _ fusefs.FileHandle, out *gofuse.AttrOut) syscall.Errno

func (*Node) Getxattr added in v1.0.3

func (n *Node) Getxattr(ctx context.Context, name string, dest []byte) (uint32, syscall.Errno)
func (n *Node) Link(ctx context.Context, target fusefs.InodeEmbedder, name string, out *gofuse.EntryOut) (*fusefs.Inode, syscall.Errno)

func (*Node) Listxattr added in v1.0.3

func (n *Node) Listxattr(ctx context.Context, dest []byte) (uint32, syscall.Errno)

func (*Node) Lookup

func (n *Node) Lookup(ctx context.Context, name string, out *gofuse.EntryOut) (*fusefs.Inode, syscall.Errno)

func (*Node) Mkdir

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

func (*Node) Mknod added in v1.0.3

func (n *Node) Mknod(ctx context.Context, name string, mode uint32, rdev uint32, out *gofuse.EntryOut) (*fusefs.Inode, syscall.Errno)

Mknod stores the path and attributes only. Linux owns socket endpoints and FIFO buffers; their traffic does not pass through the chunk data backend.

func (*Node) Open

func (*Node) Opendir

func (n *Node) Opendir(_ context.Context) syscall.Errno

func (*Node) OpendirHandle added in v1.0.1

func (n *Node) OpendirHandle(ctx context.Context, _ uint32) (fusefs.FileHandle, uint32, syscall.Errno)
func (n *Node) Readlink(ctx context.Context) ([]byte, syscall.Errno)

func (*Node) Removexattr added in v1.0.3

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

func (*Node) Rename

func (n *Node) Rename(ctx context.Context, name string, newParent fusefs.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 (*Node) Setxattr added in v1.0.3

func (n *Node) Setxattr(ctx context.Context, name string, value []byte, flags uint32) syscall.Errno

func (*Node) Statfs added in v1.0.3

func (n *Node) Statfs(ctx context.Context, out *gofuse.StatfsOut) syscall.Errno

Statfs uses shared capacity accounting. Unknown remote/object-store capacity stays zero instead of inventing an unlimited disk; real I/O errors propagate.

func (n *Node) Symlink(ctx context.Context, target, name string, out *gofuse.EntryOut) (*fusefs.Inode, syscall.Errno)
func (n *Node) Unlink(ctx context.Context, name string) syscall.Errno

type Options

type Options struct {
	AttrTTL time.Duration
	Mount   gofuse.MountOptions
	// ReadDirPlusAuto lets the kernel choose plain records for name-only scans.
	// The default keeps attributes with directory entries, benefiting callers
	// which enumerate names first and then stat them in a separate pass.
	ReadDirPlusAuto bool
	// ExclusiveMetadataCache keeps local metadata in the kernel for an hour.
	// The caller guarantees that this mount is the only namespace/data writer,
	// with no external changes, history or staging. Mount enforces the latter
	// restrictions where they are exposed by Access. SDK callers opt in.
	ExclusiveMetadataCache bool
	// DirectIO bypasses the kernel data cache for local files. The default is
	// kernel cached, write-through I/O: FUSE must own the data modification path.
	// Remote storage always uses direct I/O, regardless of this setting.
	// Direct I/O mounts do not support shared mmap.
	DirectIO bool
	// UID/GID, when set, fix the ownership exposed by this mount, including
	// newly created entries. Nil preserves stored ownership and the creator's IDs.
	UID, GID *uint32
	// Masks remove rwx bits from replies, creation and chmod. Specific masks
	// combine with Umask; existing metadata is not rewritten by mounting.
	Umask, Fmask, Dmask uint32
	// Kernel permission checks are enabled by default, including with AllowOther.
	DisablePermissions bool
}

Options contains FUSE-specific settings. Shared storage options (chunking, caches, quota and backups) are configured with fs/option in core.New.

Jump to

Keyboard shortcuts

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