nfs

package
v0.0.0-...-7cb0b6c Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKvHandler

func NewKvHandler(h nfs.Handler, fs nfs.Filesystem, config config.NFS) (nfs.Handler, error)

NewKvHandler provides a basic to/from-file handle cache that can be tuned with a smaller cache of active directory listings.

func NewNFSv3Handler

func NewNFSv3Handler(fs vfs.Filesystem, config config.NFS) (nfs.Handler, error)

Types

type CachingHandler

type CachingHandler struct {
	nfs.Handler
	// contains filtered or unexported fields
}

CachingHandler implements to/from handle via an LRU cache.

func (*CachingHandler) ActiveHandlers

func (c *CachingHandler) ActiveHandlers() int

HandleLimit exports how many file handles can be safely stored by this cache.

func (*CachingHandler) FromHandle

func (c *CachingHandler) FromHandle(ctx context.Context, fh []byte) (nfs.Filesystem, []string, error)

FromHandle converts from an opaque handle to the file it represents

func (*CachingHandler) HandleLimit

func (c *CachingHandler) HandleLimit() int

HandleLimit exports how many file handles can be safely stored by this cache.

func (*CachingHandler) InvalidateHandle

func (c *CachingHandler) InvalidateHandle(ctx context.Context, fs nfs.Filesystem, handle []byte) error

func (*CachingHandler) ToHandle

func (c *CachingHandler) ToHandle(ctx context.Context, _ nfs.Filesystem, path []string) []byte

ToHandle takes a file and represents it with an opaque handle to reference it. In stateless nfs (when it's serving a unix fs) this can be the device + inode but we can generalize with a stateful local cache of handed out IDs.

Jump to

Keyboard shortcuts

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