handle

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirHandle

type DirHandle struct {
	Mu locker.Locker
	// contains filtered or unexported fields
}

DirHandle is the state required for reading from directories.

func NewDirHandle

func NewDirHandle(
	in inode.DirInode,
	implicitDirs bool) (dh *DirHandle)

NewDirHandle creates a directory handle that obtains listings from the supplied inode.

func (*DirHandle) ReadDir

func (dh *DirHandle) ReadDir(
	ctx context.Context,
	op *fuseops.ReadDirOp,
	localFileEntries []fuseutil.Dirent) (err error)

ReadDir handles a request to read from the directory, without responding.

Special case: we assume that a zero offset indicates that rewinddir has been called (since fuse gives us no way to intercept and know for sure), and start the listing process over again.

LOCKS_REQUIRED(dh.Mu) LOCKS_EXCLUDED(du.in)

type FileHandle

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

func NewFileHandle

func NewFileHandle(inode *inode.FileInode, fileCacheHandler *file.CacheHandler, cacheFileForRangeRead bool) (fh *FileHandle)

func (*FileHandle) Destroy

func (fh *FileHandle) Destroy()

Destroy any resources associated with the handle, which must not be used again.

func (*FileHandle) Inode

func (fh *FileHandle) Inode() *inode.FileInode

Inode returns the inode backing this handle.

func (*FileHandle) Lock

func (fh *FileHandle) Lock()

func (*FileHandle) Read

func (fh *FileHandle) Read(ctx context.Context, dst []byte, offset int64, sequentialReadSizeMb int32) (n int, err error)

Equivalent to locking fh.Inode() and calling fh.Inode().Read, but may be more efficient.

LOCKS_REQUIRED(fh) LOCKS_EXCLUDED(fh.inode)

func (*FileHandle) Unlock

func (fh *FileHandle) Unlock()

Jump to

Keyboard shortcuts

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