Documentation
¶
Overview ¶
Package fuse exports the shared compactfs engine through FUSE.
Index ¶
- func Mount(storage core.Access, mountpoint string, options Options) (*gofuse.Server, error)
- type Handle
- func (h *Handle) Flush(ctx context.Context) syscall.Errno
- func (h *Handle) Fsync(ctx context.Context, _ uint32) syscall.Errno
- func (h *Handle) Lseek(ctx context.Context, off uint64, whence uint32) (uint64, syscall.Errno)
- func (h *Handle) Read(ctx context.Context, dest []byte, off int64) (gofuse.ReadResult, syscall.Errno)
- func (h *Handle) Release(ctx context.Context) syscall.Errno
- func (h *Handle) Write(ctx context.Context, data []byte, off int64) (uint32, syscall.Errno)
- type Node
- func (n *Node) Create(ctx context.Context, name string, _ uint32, mode uint32, out *gofuse.EntryOut) (*fusefs.Inode, fusefs.FileHandle, uint32, syscall.Errno)
- func (n *Node) Getattr(ctx context.Context, _ fusefs.FileHandle, out *gofuse.AttrOut) syscall.Errno
- 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, ...) (*fusefs.Inode, syscall.Errno)
- func (n *Node) Listxattr(ctx context.Context, dest []byte) (uint32, syscall.Errno)
- func (n *Node) Lookup(ctx context.Context, name string, out *gofuse.EntryOut) (*fusefs.Inode, syscall.Errno)
- func (n *Node) Mkdir(ctx context.Context, name string, mode uint32, out *gofuse.EntryOut) (*fusefs.Inode, syscall.Errno)
- func (n *Node) Mknod(ctx context.Context, name string, mode uint32, rdev uint32, ...) (*fusefs.Inode, syscall.Errno)
- func (n *Node) Open(ctx context.Context, _ uint32) (fusefs.FileHandle, uint32, syscall.Errno)
- func (n *Node) Opendir(_ context.Context) syscall.Errno
- func (n *Node) OpendirHandle(ctx context.Context, _ uint32) (fusefs.FileHandle, uint32, syscall.Errno)
- func (n *Node) Readlink(ctx context.Context) ([]byte, syscall.Errno)
- func (n *Node) Removexattr(ctx context.Context, name string) syscall.Errno
- func (n *Node) Rename(ctx context.Context, name string, newParent fusefs.InodeEmbedder, ...) syscall.Errno
- func (n *Node) Rmdir(ctx context.Context, name string) syscall.Errno
- func (n *Node) Setattr(ctx context.Context, _ fusefs.FileHandle, in *gofuse.SetAttrIn, ...) syscall.Errno
- func (n *Node) Setxattr(ctx context.Context, name string, value []byte, flags uint32) syscall.Errno
- func (n *Node) Statfs(ctx context.Context, out *gofuse.StatfsOut) syscall.Errno
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handle ¶
type Handle struct {
// contains filtered or unexported fields
}
func (*Handle) Lseek ¶ added in v1.0.3
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.
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) 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) OpendirHandle ¶ added in v1.0.1
func (*Node) Removexattr ¶ added in v1.0.3
func (*Node) Statfs ¶ added in v1.0.3
Statfs uses shared capacity accounting. Unknown remote/object-store capacity stays zero instead of inventing an unlimited disk; real I/O errors propagate.
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.