fuse: bazil.org/fuse Index | Files | Directories

package fuse

import "bazil.org/fuse"

Package fuse enables writing FUSE file systems on Linux and FreeBSD.

There are two approaches to writing a FUSE file system. The first is to speak the low-level message protocol, reading from a Conn using ReadRequest and writing using the various Respond methods. This approach is closest to the actual interaction with the kernel and can be the simplest one in contexts such as protocol translators.

Servers of synthesized file systems tend to share common bookkeeping abstracted away by the second approach, which is to call fs.Serve to serve the FUSE protocol using an implementation of the service methods in the interfaces FS* (file system), Node* (file or directory), and Handle* (opened file or directory). There are a daunting number of such methods that can be written, but few are required. The specific methods are described in the documentation for those interfaces.

The hellofs subdirectory contains a simple illustration of the fs.Serve approach.

Service Methods

The required and optional methods for the FS, Node, and Handle interfaces have the general form

Op(ctx context.Context, req *OpRequest, resp *OpResponse) error

where Op is the name of a FUSE operation. Op reads request parameters from req and writes results to resp. An operation whose only result is the error result omits the resp parameter.

Multiple goroutines may call service methods simultaneously; the methods being called are responsible for appropriate synchronization.

The operation must not hold on to the request or response, including any []byte fields such as WriteRequest.Data or SetxattrRequest.Xattr.

Errors

Operations can return errors. The FUSE interface can only communicate POSIX errno error numbers to file system clients, the message is not visible to file system clients. The returned error can implement ErrorNumber to control the errno returned. Without ErrorNumber, a generic errno (EIO) is returned.

Error messages will be visible in the debug log as part of the response.

Interrupted Operations

In some file systems, some operations may take an undetermined amount of time. For example, a Read waiting for a network message or a matching Write might wait indefinitely. If the request is cancelled and no longer needed, the context will be cancelled. Blocking operations should select on a receive from ctx.Done() and attempt to abort the operation early if the receive succeeds (meaning the channel is closed). To indicate that the operation failed because it was aborted, return syscall.EINTR.

If an operation does not block for an indefinite amount of time, supporting cancellation is not necessary.

Authentication

All requests types embed a Header, meaning that the method can inspect req.Pid, req.Uid, and req.Gid as necessary to implement permission checking. The kernel FUSE layer normally prevents other users from accessing the FUSE file system (to change this, see AllowOther), but does not enforce access modes (to change this, see DefaultPermissions).

Mount Options

Behavior and metadata of the mounted file system can be changed by passing MountOption values to Mount.

Index

Package Files

buffer.go debug.go error_linux.go error_std.go fuse.go fuse_kernel.go fuse_kernel_linux.go fuse_linux.go mount.go mount_linux.go options.go options_linux.go protocol.go unmount.go unmount_linux.go

Constants

const (
    // ENOSYS indicates that the call is not supported.
    ENOSYS = Errno(syscall.ENOSYS)

    // ESTALE is used by Serve to respond to violations of the FUSE protocol.
    ESTALE = Errno(syscall.ESTALE)

    ENOENT = Errno(syscall.ENOENT)
    EIO    = Errno(syscall.EIO)
    EPERM  = Errno(syscall.EPERM)

    // EINTR indicates request was interrupted by an InterruptRequest.
    // See also fs.Intr.
    EINTR = Errno(syscall.EINTR)

    ERANGE  = Errno(syscall.ERANGE)
    ENOTSUP = Errno(syscall.ENOTSUP)
    EEXIST  = Errno(syscall.EEXIST)
)

Deprecated: Return a syscall.Errno directly. See ToErrno for exact rules.

const DefaultErrno = EIO

DefaultErrno is the errno used when error returned does not implement ErrorNumber.

const (
    ENODATA = Errno(syscall.ENODATA)
)
const ErrNoXattr = errNoXattr

ErrNoXattr is a platform-independent error value meaning the extended attribute was not found. It can be used to respond to GetxattrRequest and such.

Variables

var (
    OSXFUSELocationV3 = OSXFUSEPaths{
        DevicePrefix: "/dev/osxfuse",
        Load:         "/Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse",
        Mount:        "/Library/Filesystems/osxfuse.fs/Contents/Resources/mount_osxfuse",
        DaemonVar:    "MOUNT_OSXFUSE_DAEMON_PATH",
    }
    OSXFUSELocationV2 = OSXFUSEPaths{
        DevicePrefix: "/dev/osxfuse",
        Load:         "/Library/Filesystems/osxfusefs.fs/Support/load_osxfusefs",
        Mount:        "/Library/Filesystems/osxfusefs.fs/Support/mount_osxfusefs",
        DaemonVar:    "MOUNT_FUSEFS_DAEMON_PATH",
    }
)

Deprecated: Not used, OS X remnant.

var Debug func(msg interface{}) = nop

Debug is called to output debug messages, including protocol traces. The default behavior is to do nothing.

The messages have human-friendly string representations and are safe to marshal to JSON.

Implementations must not retain msg.

var (
    ErrClosedWithoutInit = errors.New("fuse connection closed without init")
)
var (
    ErrNotCached = notCachedError{}
)
var (
    // Deprecated: Never used, OS X remnant.
    ErrOSXFUSENotFound = errors.New("cannot locate OSXFUSE")
)

func AppendDirent Uses

func AppendDirent(data []byte, dir Dirent) []byte

AppendDirent appends the encoded form of a directory entry to data and returns the resulting slice.

func Unmount Uses

func Unmount(dir string) error

Unmount tries to unmount the filesystem mounted at dir.

type AccessRequest Uses

type AccessRequest struct {
    Header `json:"-"`
    Mask   uint32
}

An AccessRequest asks whether the file can be accessed for the purpose specified by the mask.

func (*AccessRequest) Respond Uses

func (r *AccessRequest) Respond()

Respond replies to the request indicating that access is allowed. To deny access, use RespondError.

func (*AccessRequest) String Uses

func (r *AccessRequest) String() string

type Attr Uses

type Attr struct {
    Valid time.Duration // how long Attr can be cached

    Inode     uint64      // inode number
    Size      uint64      // size in bytes
    Blocks    uint64      // size in 512-byte units
    Atime     time.Time   // time of last access
    Mtime     time.Time   // time of last modification
    Ctime     time.Time   // time of last inode change
    Mode      os.FileMode // file mode
    Nlink     uint32      // number of links (usually 1)
    Uid       uint32      // owner uid
    Gid       uint32      // group gid
    Rdev      uint32      // device numbers
    BlockSize uint32      // preferred blocksize for filesystem I/O

    // Deprecated: Not used, OS X remnant.
    Crtime time.Time
    // Deprecated: Not used, OS X remnant.
    Flags uint32
}

An Attr is the metadata for a single file or directory.

func (Attr) String Uses

func (a Attr) String() string

type BatchForgetItem Uses

type BatchForgetItem struct {
    NodeID NodeID
    N      uint64
}

type BatchForgetRequest Uses

type BatchForgetRequest struct {
    Header `json:"-"`
    Forget []BatchForgetItem
}

func (*BatchForgetRequest) Respond Uses

func (r *BatchForgetRequest) Respond()

Respond replies to the request, indicating that the forgetfulness has been recorded.

func (*BatchForgetRequest) String Uses

func (r *BatchForgetRequest) String() string

type Conn Uses

type Conn struct {
    // Always closed, mount is ready when Mount returns.
    //
    // Deprecated: Not used, OS X remnant.
    Ready <-chan struct{}

    // Use error returned from Mount.
    //
    // Deprecated: Not used, OS X remnant.
    MountError error
    // contains filtered or unexported fields
}

A Conn represents a connection to a mounted FUSE file system.

func Mount Uses

func Mount(dir string, options ...MountOption) (*Conn, error)

Mount mounts a new FUSE connection on the named directory and returns a connection for reading and writing FUSE messages.

After a successful return, caller must call Close to free resources.

func (*Conn) Close Uses

func (c *Conn) Close() error

Close closes the FUSE connection.

func (*Conn) Features Uses

func (c *Conn) Features() InitFlags

Features reports the feature flags negotiated between the kernel and the FUSE library. See MountOption for how to influence features activated.

func (*Conn) InvalidateEntry Uses

func (c *Conn) InvalidateEntry(parent NodeID, name string) error

InvalidateEntry invalidates the kernel cache of the directory entry identified by parent directory node ID and entry basename.

Kernel may or may not cache directory listings. To invalidate those, use InvalidateNode to invalidate all of the data for a directory. (As of 2015-06, Linux FUSE does not cache directory listings.)

Returns ErrNotCached if the kernel is not currently caching the node.

func (*Conn) InvalidateNode Uses

func (c *Conn) InvalidateNode(nodeID NodeID, off int64, size int64) error

InvalidateNode invalidates the kernel cache of the attributes and a range of the data of a node.

Giving offset 0 and size -1 means all data. To invalidate just the attributes, give offset 0 and size 0.

Returns ErrNotCached if the kernel is not currently caching the node.

func (*Conn) NotifyPollWakeup Uses

func (c *Conn) NotifyPollWakeup(wakeup PollWakeup) error

NotifyPollWakeup sends a notification to the kernel to wake up all clients waiting on this node. Wakeup is a value from a PollRequest for a Handle or a Node currently alive (Forget has not been called on it).

func (*Conn) NotifyRetrieve Uses

func (c *Conn) NotifyRetrieve(notificationID RequestID, nodeID NodeID, offset uint64, size uint32) (*NotifyRetrieval, error)

func (*Conn) NotifyStore Uses

func (c *Conn) NotifyStore(nodeID NodeID, offset uint64, data []byte) error

func (*Conn) Protocol Uses

func (c *Conn) Protocol() Protocol

func (*Conn) ReadRequest Uses

func (c *Conn) ReadRequest() (Request, error)

ReadRequest returns the next FUSE request from the kernel.

Caller must call either Request.Respond or Request.RespondError in a reasonable time. Caller must not retain Request after that call.

type CreateRequest Uses

type CreateRequest struct {
    Header `json:"-"`
    Name   string
    Flags  OpenFlags
    Mode   os.FileMode
    // Umask of the request.
    Umask os.FileMode
}

A CreateRequest asks to create and open a file (not a directory).

func (*CreateRequest) Respond Uses

func (r *CreateRequest) Respond(resp *CreateResponse)

Respond replies to the request with the given response.

func (*CreateRequest) String Uses

func (r *CreateRequest) String() string

type CreateResponse Uses

type CreateResponse struct {
    LookupResponse
    OpenResponse
}

A CreateResponse is the response to a CreateRequest. It describes the created node and opened handle.

func (*CreateResponse) String Uses

func (r *CreateResponse) String() string

type DestroyRequest Uses

type DestroyRequest struct {
    Header `json:"-"`
}

A DestroyRequest is sent by the kernel when unmounting the file system. No more requests will be received after this one, but it should still be responded to.

func (*DestroyRequest) Respond Uses

func (r *DestroyRequest) Respond()

Respond replies to the request.

func (*DestroyRequest) String Uses

func (r *DestroyRequest) String() string

type Dirent Uses

type Dirent struct {
    // Inode this entry names.
    Inode uint64

    // Type of the entry, for example DT_File.
    //
    // Setting this is optional. The zero value (DT_Unknown) means
    // callers will just need to do a Getattr when the type is
    // needed. Providing a type can speed up operations
    // significantly.
    Type DirentType

    // Name of the entry
    Name string
}

A Dirent represents a single directory entry.

type DirentType Uses

type DirentType uint32

Type of an entry in a directory listing.

const (
    DT_Unknown DirentType = 0
    DT_Socket  DirentType = syscall.S_IFSOCK >> 12
    DT_Link    DirentType = syscall.S_IFLNK >> 12
    DT_File    DirentType = syscall.S_IFREG >> 12
    DT_Block   DirentType = syscall.S_IFBLK >> 12
    DT_Dir     DirentType = syscall.S_IFDIR >> 12
    DT_Char    DirentType = syscall.S_IFCHR >> 12
    DT_FIFO    DirentType = syscall.S_IFIFO >> 12
)

func (DirentType) String Uses

func (t DirentType) String() string

type Errno Uses

type Errno syscall.Errno

Errno implements Error and ErrorNumber using a syscall.Errno.

func ToErrno Uses

func ToErrno(err error) Errno

ToErrno converts arbitrary errors to Errno.

If the underlying type of err is syscall.Errno, it is used directly. No unwrapping is done, to prevent wrong errors from leaking via e.g. *os.PathError.

If err unwraps to implement ErrorNumber, that is used.

Finally, returns DefaultErrno.

func (Errno) Errno Uses

func (e Errno) Errno() Errno

func (Errno) ErrnoName Uses

func (e Errno) ErrnoName() string

ErrnoName returns the short non-numeric identifier for this errno. For example, "EIO".

func (Errno) Error Uses

func (e Errno) Error() string

func (Errno) MarshalText Uses

func (e Errno) MarshalText() ([]byte, error)

func (Errno) String Uses

func (e Errno) String() string

type ErrorNumber Uses

type ErrorNumber interface {
    // Errno returns the the error number (errno) for this error.
    Errno() Errno
}

An ErrorNumber is an error with a specific error number.

Operations may return an error value that implements ErrorNumber to control what specific error number (errno) to return.

type ExchangeDataRequest Uses

type ExchangeDataRequest struct {
    Header           `json:"-"`
    OldDir, NewDir   NodeID
    OldName, NewName string
}

Deprecated: Not used, OS X remnant.

func (*ExchangeDataRequest) Respond Uses

func (r *ExchangeDataRequest) Respond()

func (*ExchangeDataRequest) String Uses

func (r *ExchangeDataRequest) String() string

type FileLock Uses

type FileLock struct {
    Start uint64
    End   uint64
    Type  LockType
    PID   int32
}

type FlushRequest Uses

type FlushRequest struct {
    Header `json:"-"`
    Handle HandleID
    // Deprecated: Unused since 2006.
    Flags     uint32
    LockOwner LockOwner
}

A FlushRequest asks for the current state of an open file to be flushed to storage, as when a file descriptor is being closed. A single opened Handle may receive multiple FlushRequests over its lifetime.

func (*FlushRequest) Respond Uses

func (r *FlushRequest) Respond()

Respond replies to the request, indicating that the flush succeeded.

func (*FlushRequest) String Uses

func (r *FlushRequest) String() string

type ForgetRequest Uses

type ForgetRequest struct {
    Header `json:"-"`
    N      uint64
}

A ForgetRequest is sent by the kernel when forgetting about r.Node as returned by r.N lookup requests.

func (*ForgetRequest) Respond Uses

func (r *ForgetRequest) Respond()

Respond replies to the request, indicating that the forgetfulness has been recorded.

func (*ForgetRequest) String Uses

func (r *ForgetRequest) String() string

type FsyncRequest Uses

type FsyncRequest struct {
    Header `json:"-"`
    Handle HandleID
    // TODO bit 1 is datasync, not well documented upstream
    Flags uint32
    Dir   bool
}

func (*FsyncRequest) Respond Uses

func (r *FsyncRequest) Respond()

func (*FsyncRequest) String Uses

func (r *FsyncRequest) String() string

type GetattrFlags Uses

type GetattrFlags uint32

GetattrFlags are bit flags that can be seen in GetattrRequest.

const (
    // Indicates the handle is valid.
    GetattrFh GetattrFlags = 1 << 0
)

func (GetattrFlags) String Uses

func (fl GetattrFlags) String() string

type GetattrRequest Uses

type GetattrRequest struct {
    Header `json:"-"`
    Flags  GetattrFlags
    Handle HandleID
}

A GetattrRequest asks for the metadata for the file denoted by r.Node.

func (*GetattrRequest) Respond Uses

func (r *GetattrRequest) Respond(resp *GetattrResponse)

Respond replies to the request with the given response.

func (*GetattrRequest) String Uses

func (r *GetattrRequest) String() string

type GetattrResponse Uses

type GetattrResponse struct {
    Attr Attr // file attributes
}

A GetattrResponse is the response to a GetattrRequest.

func (*GetattrResponse) String Uses

func (r *GetattrResponse) String() string

type GetxattrRequest Uses

type GetxattrRequest struct {
    Header `json:"-"`

    // Maximum size to return.
    Size uint32

    // Name of the attribute requested.
    Name string

    // Deprecated: Not used, OS X remnant.
    Position uint32
}

A GetxattrRequest asks for the extended attributes associated with r.Node.

func (*GetxattrRequest) Respond Uses

func (r *GetxattrRequest) Respond(resp *GetxattrResponse)

Respond replies to the request with the given response.

func (*GetxattrRequest) String Uses

func (r *GetxattrRequest) String() string

type GetxattrResponse Uses

type GetxattrResponse struct {
    Xattr []byte
}

A GetxattrResponse is the response to a GetxattrRequest.

func (*GetxattrResponse) String Uses

func (r *GetxattrResponse) String() string

type HandleID Uses

type HandleID uint64

A HandleID is a number identifying an open directory or file. It only needs to be unique while the directory or file is open.

func (HandleID) String Uses

func (h HandleID) String() string
type Header struct {
    Conn *Conn     `json:"-"` // connection this request was received on
    ID   RequestID // unique ID for request
    Node NodeID    // file or directory the request is about
    Uid  uint32    // user ID of process making request
    Gid  uint32    // group ID of process making request
    Pid  uint32    // process ID of process making request
    // contains filtered or unexported fields
}

A Header describes the basic information sent in every request.

func (*Header) Hdr Uses

func (h *Header) Hdr() *Header

func (*Header) RespondError Uses

func (h *Header) RespondError(err error)

func (*Header) String Uses

func (h *Header) String() string

type InitFlags Uses

type InitFlags uint32

The InitFlags are used in the Init exchange.

const (
    InitAsyncRead     InitFlags = 1 << 0
    InitPOSIXLocks    InitFlags = 1 << 1
    InitFileOps       InitFlags = 1 << 2
    InitAtomicTrunc   InitFlags = 1 << 3
    InitExportSupport InitFlags = 1 << 4
    InitBigWrites     InitFlags = 1 << 5
    // Do not mask file access modes with umask.
    InitDontMask        InitFlags = 1 << 6
    InitSpliceWrite     InitFlags = 1 << 7
    InitSpliceMove      InitFlags = 1 << 8
    InitSpliceRead      InitFlags = 1 << 9
    InitFlockLocks      InitFlags = 1 << 10
    InitHasIoctlDir     InitFlags = 1 << 11
    InitAutoInvalData   InitFlags = 1 << 12
    InitDoReaddirplus   InitFlags = 1 << 13
    InitReaddirplusAuto InitFlags = 1 << 14
    InitAsyncDIO        InitFlags = 1 << 15
    InitWritebackCache  InitFlags = 1 << 16
    InitNoOpenSupport   InitFlags = 1 << 17

    // Deprecated: Not used, OS X remnant.
    InitCaseSensitive InitFlags = 1 << 29
    // Deprecated: Not used, OS X remnant.
    InitVolRename InitFlags = 1 << 30
    // Deprecated: Not used, OS X remnant.
    InitXtimes InitFlags = 1 << 31
)

func (InitFlags) String Uses

func (fl InitFlags) String() string

type InterruptRequest Uses

type InterruptRequest struct {
    Header `json:"-"`
    IntrID RequestID // ID of the request to be interrupt.
}

An InterruptRequest is a request to interrupt another pending request. The response to that request should return an error status of EINTR.

func (*InterruptRequest) Respond Uses

func (r *InterruptRequest) Respond()

func (*InterruptRequest) String Uses

func (r *InterruptRequest) String() string

type LinkRequest Uses

type LinkRequest struct {
    Header  `json:"-"`
    OldNode NodeID
    NewName string
}

A LinkRequest is a request to create a hard link.

func (*LinkRequest) Respond Uses

func (r *LinkRequest) Respond(resp *LookupResponse)

func (*LinkRequest) String Uses

func (r *LinkRequest) String() string

type ListxattrRequest Uses

type ListxattrRequest struct {
    Header `json:"-"`
    Size   uint32 // maximum size to return

    // Deprecated: Not used, OS X remnant.
    Position uint32
}

A ListxattrRequest asks to list the extended attributes associated with r.Node.

func (*ListxattrRequest) Respond Uses

func (r *ListxattrRequest) Respond(resp *ListxattrResponse)

Respond replies to the request with the given response.

func (*ListxattrRequest) String Uses

func (r *ListxattrRequest) String() string

type ListxattrResponse Uses

type ListxattrResponse struct {
    Xattr []byte
}

A ListxattrResponse is the response to a ListxattrRequest.

func (*ListxattrResponse) Append Uses

func (r *ListxattrResponse) Append(names ...string)

Append adds an extended attribute name to the response.

func (*ListxattrResponse) String Uses

func (r *ListxattrResponse) String() string

type LockFlags Uses

type LockFlags uint32

The LockFlags are passed in LockRequest or LockWaitRequest.

const (
    // BSD-style flock lock (not POSIX lock)
    LockFlock LockFlags = 1 << 0
)

func (LockFlags) String Uses

func (fl LockFlags) String() string

type LockOwner Uses

type LockOwner uint64

LockOwner is a file-local opaque identifier assigned by the kernel to identify the owner of a particular lock.

func (LockOwner) String Uses

func (o LockOwner) String() string

type LockRequest Uses

type LockRequest struct {
    Header
    Handle HandleID
    // LockOwner is a unique identifier for the originating client, to
    // identify locks.
    LockOwner LockOwner
    Lock      FileLock
    LockFlags LockFlags
}

LockRequest asks to try acquire a byte range lock on a node. The response should be immediate, do not wait to obtain lock.

Unlocking can be

- explicit with UnlockRequest
- for flock: implicit on final close (ReleaseRequest.ReleaseFlags
  has ReleaseFlockUnlock set)
- for POSIX locks: implicit on any close (FlushRequest)
- for Open File Description locks: implicit on final close
  (no LockOwner observed as of 2020-04)

See LockFlags to know which kind of a lock is being requested. (As of 2020-04, Open File Descriptor locks are indistinguishable from POSIX. This means programs using those locks will likely misbehave when closing FDs on FUSE-based distributed filesystems, as the filesystem has no better knowledge than to follow POSIX locking rules and release the global lock too early.)

Most of the other differences between flock (BSD) and POSIX (fcntl F_SETLK) locks are relevant only to the caller, not the filesystem. FUSE always sees ranges, and treats flock whole-file locks as requests for the maximum byte range. Filesystems should do the same, as this provides a forwards compatibility path to Linux-native Open file description locks.

To enable locking events in FUSE, pass LockingFlock() and/or LockingPOSIX() to Mount.

See also LockWaitRequest.

func (*LockRequest) Respond Uses

func (r *LockRequest) Respond()

func (*LockRequest) String Uses

func (r *LockRequest) String() string

type LockType Uses

type LockType uint32
const (
    LockRead   LockType = unix.F_RDLCK
    LockWrite  LockType = unix.F_WRLCK
    LockUnlock LockType = unix.F_UNLCK
)

func (LockType) String Uses

func (l LockType) String() string

type LockWaitRequest Uses

type LockWaitRequest LockRequest

LockWaitRequest asks to acquire a byte range lock on a node, delaying response until lock can be obtained (or the request is interrupted).

See LockRequest. LockWaitRequest can be converted to a LockRequest.

func (*LockWaitRequest) Respond Uses

func (r *LockWaitRequest) Respond()

func (*LockWaitRequest) String Uses

func (r *LockWaitRequest) String() string

type LookupRequest Uses

type LookupRequest struct {
    Header `json:"-"`
    Name   string
}

A LookupRequest asks to look up the given name in the directory named by r.Node.

func (*LookupRequest) Respond Uses

func (r *LookupRequest) Respond(resp *LookupResponse)

Respond replies to the request with the given response.

func (*LookupRequest) String Uses

func (r *LookupRequest) String() string

type LookupResponse Uses

type LookupResponse struct {
    Node       NodeID
    Generation uint64
    EntryValid time.Duration
    Attr       Attr
}

A LookupResponse is the response to a LookupRequest.

func (*LookupResponse) String Uses

func (r *LookupResponse) String() string

type MkdirRequest Uses

type MkdirRequest struct {
    Header `json:"-"`
    Name   string
    Mode   os.FileMode
    // Umask of the request.
    Umask os.FileMode
}

A MkdirRequest asks to create (but not open) a directory.

func (*MkdirRequest) Respond Uses

func (r *MkdirRequest) Respond(resp *MkdirResponse)

Respond replies to the request with the given response.

func (*MkdirRequest) String Uses

func (r *MkdirRequest) String() string

type MkdirResponse Uses

type MkdirResponse struct {
    LookupResponse
}

A MkdirResponse is the response to a MkdirRequest.

func (*MkdirResponse) String Uses

func (r *MkdirResponse) String() string

type MknodRequest Uses

type MknodRequest struct {
    Header `json:"-"`
    Name   string
    Mode   os.FileMode
    Rdev   uint32
    // Umask of the request.
    Umask os.FileMode
}

func (*MknodRequest) Respond Uses

func (r *MknodRequest) Respond(resp *LookupResponse)

func (*MknodRequest) String Uses

func (r *MknodRequest) String() string

type MountOption Uses

type MountOption mountOption

MountOption is passed to Mount to change the behavior of the mount.

func AllowDev Uses

func AllowDev() MountOption

AllowDev enables interpreting character or block special devices on the filesystem.

func AllowNonEmptyMount Uses

func AllowNonEmptyMount() MountOption

AllowNonEmptyMount allows the mounting over a non-empty directory.

The files in it will be shadowed by the freshly created mount. By default these mounts are rejected to prevent accidental covering up of data, which could for example prevent automatic backup.

func AllowOther Uses

func AllowOther() MountOption

AllowOther allows other users to access the file system.

func AllowSUID Uses

func AllowSUID() MountOption

AllowSUID allows set-user-identifier or set-group-identifier bits to take effect.

func AsyncRead Uses

func AsyncRead() MountOption

AsyncRead enables multiple outstanding read requests for the same handle. Without this, there is at most one request in flight at a time.

func CongestionThreshold Uses

func CongestionThreshold(n uint16) MountOption

CongestionThreshold sets the number of outstanding background FUSE requests beyond which the kernel considers the filesystem congested. This may help with request latency.

On Linux, this can be adjusted on the fly with /sys/fs/fuse/connections/CONN/congestion_threshold

func DaemonTimeout Uses

func DaemonTimeout(name string) MountOption

DaemonTimeout sets the time in seconds between a request and a reply before the FUSE mount is declared dead.

FreeBSD only. Others ignore this option.

func DefaultPermissions Uses

func DefaultPermissions() MountOption

DefaultPermissions makes the kernel enforce access control based on the file mode (as in chmod).

Without this option, the Node itself decides what is and is not allowed. This is normally ok because FUSE file systems cannot be accessed by other users without AllowOther.

FreeBSD ignores this option.

func ExclCreate Uses

func ExclCreate() MountOption

Deprecated: Ignored, OS X remnant.

func FSName Uses

func FSName(name string) MountOption

FSName sets the file system name (also called source) that is visible in the list of mounted file systems.

FreeBSD ignores this option.

func LocalVolume Uses

func LocalVolume() MountOption

Deprecated: Ignored, OS X remnant.

func LockingFlock Uses

func LockingFlock() MountOption

LockingFlock enables flock-based (BSD) locking. This is mostly useful for distributed filesystems with global locking. Without this, kernel manages local locking automatically.

func LockingPOSIX Uses

func LockingPOSIX() MountOption

LockingPOSIX enables flock-based (BSD) locking. This is mostly useful for distributed filesystems with global locking. Without this, kernel manages local locking automatically.

Beware POSIX locks are a broken API with unintuitive behavior for callers.

func MaxBackground Uses

func MaxBackground(n uint16) MountOption

MaxBackground sets the maximum number of FUSE requests the kernel will submit in the background. Background requests are used when an immediate answer is not needed. This may help with request latency.

On Linux, this can be adjusted on the fly with /sys/fs/fuse/connections/CONN/max_background

func MaxReadahead Uses

func MaxReadahead(n uint32) MountOption

MaxReadahead sets the number of bytes that can be prefetched for sequential reads. The kernel can enforce a maximum value lower than this.

This setting makes the kernel perform speculative reads that do not originate from any client process. This usually tremendously improves read performance.

func NoAppleDouble Uses

func NoAppleDouble() MountOption

Deprecated: Ignored, OS X remnant.

func NoAppleXattr Uses

func NoAppleXattr() MountOption

Deprecated: Ignored, OS X remnant.

func NoBrowse Uses

func NoBrowse() MountOption

Deprecated: Ignored, OS X remnant.

func OSXFUSELocations Uses

func OSXFUSELocations(paths ...OSXFUSEPaths) MountOption

Deprecated: Ignored, OS X remnant.

func ReadOnly Uses

func ReadOnly() MountOption

ReadOnly makes the mount read-only.

func Subtype Uses

func Subtype(fstype string) MountOption

Subtype sets the subtype of the mount. The main type is always `fuse`. The type in a list of mounted file systems will look like `fuse.foo`.

FreeBSD ignores this option.

func VolumeName Uses

func VolumeName(name string) MountOption

Deprecated: Ignored, OS X remnant.

func WritebackCache Uses

func WritebackCache() MountOption

WritebackCache enables the kernel to buffer writes before sending them to the FUSE server. Without this, writethrough caching is used.

type MountpointDoesNotExistError Uses

type MountpointDoesNotExistError struct {
    Path string
}

MountpointDoesNotExistError is an error returned when the mountpoint does not exist.

func (*MountpointDoesNotExistError) Error Uses

func (e *MountpointDoesNotExistError) Error() string

type NodeID Uses

type NodeID uint64

A NodeID is a number identifying a directory or file. It must be unique among IDs returned in LookupResponses that have not yet been forgotten by ForgetRequests.

const RootID NodeID = rootID

The RootID identifies the root directory of a FUSE file system.

func (NodeID) String Uses

func (n NodeID) String() string

type NotifyReply Uses

type NotifyReply struct {
    Header `json:"-"`
    // contains filtered or unexported fields
}

NotifyReply is a response to an earlier notification. It behaves like a Request, but is not really a request expecting a response.

func (*NotifyReply) String Uses

func (r *NotifyReply) String() string

type NotifyRetrieval Uses

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

func (*NotifyRetrieval) Finish Uses

func (n *NotifyRetrieval) Finish(r *NotifyReply) []byte

type OSXFUSEPaths Uses

type OSXFUSEPaths struct {
    // Prefix for the device file. At mount time, an incrementing
    // number is suffixed until a free FUSE device is found.
    DevicePrefix string
    // Path of the load helper, used to load the kernel extension if
    // no device files are found.
    Load string
    // Path of the mount helper, used for the actual mount operation.
    Mount string
    // Environment variable used to pass the path to the executable
    // calling the mount helper.
    DaemonVar string
}

Deprecated: Not used, OS X remnant.

type OldVersionError Uses

type OldVersionError struct {
    Kernel     Protocol
    LibraryMin Protocol
}

func (*OldVersionError) Error Uses

func (e *OldVersionError) Error() string

type OpenFlags Uses

type OpenFlags uint32

OpenFlags are the O_FOO flags passed to open/create/etc calls. For example, os.O_WRONLY | os.O_APPEND.

const (
    // Access modes. These are not 1-bit flags, but alternatives where
    // only one can be chosen. See the IsReadOnly etc convenience
    // methods.
    OpenReadOnly  OpenFlags = syscall.O_RDONLY
    OpenWriteOnly OpenFlags = syscall.O_WRONLY
    OpenReadWrite OpenFlags = syscall.O_RDWR

    // File was opened in append-only mode, all writes will go to end
    // of file. FreeBSD does not provide this information.
    OpenAppend    OpenFlags = syscall.O_APPEND
    OpenCreate    OpenFlags = syscall.O_CREAT
    OpenDirectory OpenFlags = syscall.O_DIRECTORY
    OpenExclusive OpenFlags = syscall.O_EXCL
    OpenNonblock  OpenFlags = syscall.O_NONBLOCK
    OpenSync      OpenFlags = syscall.O_SYNC
    OpenTruncate  OpenFlags = syscall.O_TRUNC
)

Flags that can be seen in OpenRequest.Flags.

const OpenAccessModeMask OpenFlags = syscall.O_ACCMODE

OpenAccessModeMask is a bitmask that separates the access mode from the other flags in OpenFlags.

func (OpenFlags) IsReadOnly Uses

func (fl OpenFlags) IsReadOnly() bool

Return true if OpenReadOnly is set.

func (OpenFlags) IsReadWrite Uses

func (fl OpenFlags) IsReadWrite() bool

Return true if OpenReadWrite is set.

func (OpenFlags) IsWriteOnly Uses

func (fl OpenFlags) IsWriteOnly() bool

Return true if OpenWriteOnly is set.

func (OpenFlags) String Uses

func (fl OpenFlags) String() string

type OpenRequest Uses

type OpenRequest struct {
    Header `json:"-"`
    Dir    bool // is this Opendir?
    Flags  OpenFlags
}

An OpenRequest asks to open a file or directory

func (*OpenRequest) Respond Uses

func (r *OpenRequest) Respond(resp *OpenResponse)

Respond replies to the request with the given response.

func (*OpenRequest) String Uses

func (r *OpenRequest) String() string

type OpenResponse Uses

type OpenResponse struct {
    Handle HandleID
    Flags  OpenResponseFlags
}

A OpenResponse is the response to a OpenRequest.

func (*OpenResponse) String Uses

func (r *OpenResponse) String() string

type OpenResponseFlags Uses

type OpenResponseFlags uint32

The OpenResponseFlags are returned in the OpenResponse.

const (
    OpenDirectIO    OpenResponseFlags = 1 << 0 // bypass page cache for this open file
    OpenKeepCache   OpenResponseFlags = 1 << 1 // don't invalidate the data cache on open
    OpenNonSeekable OpenResponseFlags = 1 << 2 // mark the file as non-seekable (not supported on FreeBSD)

    // Deprecated: Not used, OS X remnant.
    OpenPurgeAttr OpenResponseFlags = 1 << 30
    // Deprecated: Not used, OS X remnant.
    OpenPurgeUBC OpenResponseFlags = 1 << 31
)

func (OpenResponseFlags) String Uses

func (fl OpenResponseFlags) String() string

type PollEvents Uses

type PollEvents uint32
const (
    PollIn       PollEvents = 0x0000_0001
    PollPriority PollEvents = 0x0000_0002
    PollOut      PollEvents = 0x0000_0004
    PollError    PollEvents = 0x0000_0008
    PollHangup   PollEvents = 0x0000_0010
    // PollInvalid doesn't seem to be used in the FUSE protocol.
    PollInvalid        PollEvents = 0x0000_0020
    PollReadNormal     PollEvents = 0x0000_0040
    PollReadOutOfBand  PollEvents = 0x0000_0080
    PollWriteNormal    PollEvents = 0x0000_0100
    PollWriteOutOfBand PollEvents = 0x0000_0200
    PollMessage        PollEvents = 0x0000_0400
    PollReadHangup     PollEvents = 0x0000_2000

    DefaultPollMask = PollIn | PollOut | PollReadNormal | PollWriteNormal
)

func (PollEvents) String Uses

func (fl PollEvents) String() string

type PollFlags Uses

type PollFlags uint32

PollFlags are passed in PollRequest.Flags

const (
    // PollScheduleNotify requests that a poll notification is done
    // once the node is ready.
    PollScheduleNotify PollFlags = 1 << 0
)

func (PollFlags) String Uses

func (fl PollFlags) String() string

type PollRequest Uses

type PollRequest struct {
    Header `json:"-"`
    Handle HandleID

    Flags PollFlags
    // Events is a bitmap of events of interest.
    //
    // This field is only set for FUSE protocol 7.21 and later.
    Events PollEvents
    // contains filtered or unexported fields
}

func (*PollRequest) Respond Uses

func (r *PollRequest) Respond(resp *PollResponse)

func (*PollRequest) String Uses

func (r *PollRequest) String() string

func (*PollRequest) Wakeup Uses

func (r *PollRequest) Wakeup() (_ PollWakeup, ok bool)

Wakeup returns information that can be used later to wake up file system clients polling a Handle or a Node.

ok is false if wakeups are not requested for this poll.

Do not retain PollWakeup past the lifetime of the Handle or Node.

type PollResponse Uses

type PollResponse struct {
    REvents PollEvents
}

func (*PollResponse) String Uses

func (r *PollResponse) String() string

type PollWakeup Uses

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

func (PollWakeup) String Uses

func (p PollWakeup) String() string

type Protocol Uses

type Protocol struct {
    Major uint32
    Minor uint32
}

Protocol is a FUSE protocol version number.

func (Protocol) GE Uses

func (a Protocol) GE(b Protocol) bool

GE returns whether a is greater than or equal to b.

func (Protocol) HasAttrBlockSize Uses

func (a Protocol) HasAttrBlockSize() bool

HasAttrBlockSize returns whether Attr.BlockSize is respected by the kernel.

Deprecated: Guaranteed to be true with our minimum supported protocol version.

func (Protocol) HasGetattrFlags Uses

func (a Protocol) HasGetattrFlags() bool

HasGetattrFlags returns whether GetattrRequest field Flags is valid.

Deprecated: Guaranteed to be true with our minimum supported protocol version.

func (Protocol) HasInvalidate Uses

func (a Protocol) HasInvalidate() bool

HasInvalidate returns whether InvalidateNode/InvalidateEntry are supported.

Deprecated: Guaranteed to be true with our minimum supported protocol version.

func (Protocol) HasOpenNonSeekable Uses

func (a Protocol) HasOpenNonSeekable() bool

HasOpenNonSeekable returns whether OpenResponse field Flags flag OpenNonSeekable is supported.

Deprecated: Guaranteed to be true with our minimum supported protocol version.

func (Protocol) HasReadWriteFlags Uses

func (a Protocol) HasReadWriteFlags() bool

HasReadWriteFlags returns whether ReadRequest/WriteRequest fields Flags and FileFlags are valid.

Deprecated: Guaranteed to be true with our minimum supported protocol version.

func (Protocol) HasUmask Uses

func (a Protocol) HasUmask() bool

HasUmask returns whether CreateRequest/MkdirRequest/MknodRequest field Umask is valid.

Deprecated: Guaranteed to be true with our minimum supported protocol version.

func (Protocol) LT Uses

func (a Protocol) LT(b Protocol) bool

LT returns whether a is less than b.

func (Protocol) String Uses

func (p Protocol) String() string

type QueryLockRequest Uses

type QueryLockRequest struct {
    Header
    Handle    HandleID
    LockOwner LockOwner
    Lock      FileLock
    LockFlags LockFlags
}

QueryLockRequest queries the lock status.

If the lock could be placed, set response Lock.Type to unix.F_UNLCK.

If there are conflicting locks, the response should describe one of them. For Open File Description locks, set PID to -1. (This is probably also the sane behavior for locks held by remote parties.)

func (*QueryLockRequest) Respond Uses

func (r *QueryLockRequest) Respond(resp *QueryLockResponse)

Respond replies to the request with the given response.

func (*QueryLockRequest) String Uses

func (r *QueryLockRequest) String() string

type QueryLockResponse Uses

type QueryLockResponse struct {
    Lock FileLock
}

func (*QueryLockResponse) String Uses

func (r *QueryLockResponse) String() string

type ReadFlags Uses

type ReadFlags uint32

The ReadFlags are passed in ReadRequest.

const (
    // LockOwner field is valid.
    ReadLockOwner ReadFlags = 1 << 1
)

func (ReadFlags) String Uses

func (fl ReadFlags) String() string

type ReadRequest Uses

type ReadRequest struct {
    Header    `json:"-"`
    Dir       bool // is this Readdir?
    Handle    HandleID
    Offset    int64
    Size      int
    Flags     ReadFlags
    LockOwner LockOwner
    FileFlags OpenFlags
}

A ReadRequest asks to read from an open file.

func (*ReadRequest) Respond Uses

func (r *ReadRequest) Respond(resp *ReadResponse)

Respond replies to the request with the given response.

func (*ReadRequest) String Uses

func (r *ReadRequest) String() string

type ReadResponse Uses

type ReadResponse struct {
    Data []byte
}

A ReadResponse is the response to a ReadRequest.

func (*ReadResponse) MarshalJSON Uses

func (r *ReadResponse) MarshalJSON() ([]byte, error)

func (*ReadResponse) String Uses

func (r *ReadResponse) String() string

type ReadlinkRequest Uses

type ReadlinkRequest struct {
    Header `json:"-"`
}

A ReadlinkRequest is a request to read a symlink's target.

func (*ReadlinkRequest) Respond Uses

func (r *ReadlinkRequest) Respond(target string)

func (*ReadlinkRequest) String Uses

func (r *ReadlinkRequest) String() string

type ReleaseFlags Uses

type ReleaseFlags uint32

The ReleaseFlags are used in the Release exchange.

const (
    ReleaseFlush       ReleaseFlags = 1 << 0
    ReleaseFlockUnlock ReleaseFlags = 1 << 1
)

func (ReleaseFlags) String Uses

func (fl ReleaseFlags) String() string

type ReleaseRequest Uses

type ReleaseRequest struct {
    Header       `json:"-"`
    Dir          bool // is this Releasedir?
    Handle       HandleID
    Flags        OpenFlags // flags from OpenRequest
    ReleaseFlags ReleaseFlags
    LockOwner    LockOwner
}

A ReleaseRequest asks to release (close) an open file handle.

func (*ReleaseRequest) Respond Uses

func (r *ReleaseRequest) Respond()

Respond replies to the request, indicating that the handle has been released.

func (*ReleaseRequest) String Uses

func (r *ReleaseRequest) String() string

type RemoveRequest Uses

type RemoveRequest struct {
    Header `json:"-"`
    Name   string // name of the entry to remove
    Dir    bool   // is this rmdir?
}

A RemoveRequest asks to remove a file or directory from the directory r.Node.

func (*RemoveRequest) Respond Uses

func (r *RemoveRequest) Respond()

Respond replies to the request, indicating that the file was removed.

func (*RemoveRequest) String Uses

func (r *RemoveRequest) String() string

type RemovexattrRequest Uses

type RemovexattrRequest struct {
    Header `json:"-"`
    Name   string // name of extended attribute
}

A RemovexattrRequest asks to remove an extended attribute associated with r.Node.

func (*RemovexattrRequest) Respond Uses

func (r *RemovexattrRequest) Respond()

Respond replies to the request, indicating that the attribute was removed.

func (*RemovexattrRequest) String Uses

func (r *RemovexattrRequest) String() string

type RenameRequest Uses

type RenameRequest struct {
    Header           `json:"-"`
    NewDir           NodeID
    OldName, NewName string
}

A RenameRequest is a request to rename a file.

func (*RenameRequest) Respond Uses

func (r *RenameRequest) Respond()

func (*RenameRequest) String Uses

func (r *RenameRequest) String() string

type Request Uses

type Request interface {
    // Hdr returns the Header associated with this request.
    Hdr() *Header

    // RespondError responds to the request with the given error.
    RespondError(error)

    String() string
}

A Request represents a single FUSE request received from the kernel. Use a type switch to determine the specific kind. A request of unrecognized type will have concrete type *Header.

type RequestID Uses

type RequestID uint64

A RequestID identifies an active FUSE request.

func (RequestID) String Uses

func (r RequestID) String() string

type SetattrRequest Uses

type SetattrRequest struct {
    Header `json:"-"`
    Valid  SetattrValid
    Handle HandleID
    Size   uint64
    Atime  time.Time
    Mtime  time.Time
    // Mode is the file mode to set (when valid).
    //
    // The type of the node (as in os.ModeType, os.ModeDir etc) is not
    // guaranteed to be sent by the kernel, in which case
    // os.ModeIrregular will be set.
    Mode os.FileMode
    Uid  uint32
    Gid  uint32

    // Deprecated: Not used, OS X remnant.
    Bkuptime time.Time
    // Deprecated: Not used, OS X remnant.
    Chgtime time.Time
    // Deprecated: Not used, OS X remnant.
    Crtime time.Time
    // Deprecated: Not used, OS X remnant.
    Flags uint32
}

A SetattrRequest asks to change one or more attributes associated with a file, as indicated by Valid.

func (*SetattrRequest) Respond Uses

func (r *SetattrRequest) Respond(resp *SetattrResponse)

Respond replies to the request with the given response, giving the updated attributes.

func (*SetattrRequest) String Uses

func (r *SetattrRequest) String() string

type SetattrResponse Uses

type SetattrResponse struct {
    Attr Attr // file attributes
}

A SetattrResponse is the response to a SetattrRequest.

func (*SetattrResponse) String Uses

func (r *SetattrResponse) String() string

type SetattrValid Uses

type SetattrValid uint32

The SetattrValid are bit flags describing which fields in the SetattrRequest are included in the change.

const (
    SetattrMode      SetattrValid = 1 << 0
    SetattrUid       SetattrValid = 1 << 1
    SetattrGid       SetattrValid = 1 << 2
    SetattrSize      SetattrValid = 1 << 3
    SetattrAtime     SetattrValid = 1 << 4
    SetattrMtime     SetattrValid = 1 << 5
    SetattrHandle    SetattrValid = 1 << 6
    SetattrAtimeNow  SetattrValid = 1 << 7
    SetattrMtimeNow  SetattrValid = 1 << 8
    SetattrLockOwner SetattrValid = 1 << 9 // http://www.mail-archive.com/git-commits-head@vger.kernel.org/msg27852.html

    // Deprecated: Not used, OS X remnant.
    SetattrCrtime SetattrValid = 1 << 28
    // Deprecated: Not used, OS X remnant.
    SetattrChgtime SetattrValid = 1 << 29
    // Deprecated: Not used, OS X remnant.
    SetattrBkuptime SetattrValid = 1 << 30
    // Deprecated: Not used, OS X remnant.
    SetattrFlags SetattrValid = 1 << 31
)

func (SetattrValid) Atime Uses

func (fl SetattrValid) Atime() bool

func (SetattrValid) AtimeNow Uses

func (fl SetattrValid) AtimeNow() bool

func (SetattrValid) Bkuptime Uses

func (fl SetattrValid) Bkuptime() bool

Deprecated: Not used, OS X remnant.

func (SetattrValid) Chgtime Uses

func (fl SetattrValid) Chgtime() bool

Deprecated: Not used, OS X remnant.

func (SetattrValid) Crtime Uses

func (fl SetattrValid) Crtime() bool

Deprecated: Not used, OS X remnant.

func (SetattrValid) Flags Uses

func (fl SetattrValid) Flags() bool

Deprecated: Not used, OS X remnant.

func (SetattrValid) Gid Uses

func (fl SetattrValid) Gid() bool

func (SetattrValid) Handle Uses

func (fl SetattrValid) Handle() bool

func (SetattrValid) LockOwner Uses

func (fl SetattrValid) LockOwner() bool

func (SetattrValid) Mode Uses

func (fl SetattrValid) Mode() bool

func (SetattrValid) Mtime Uses

func (fl SetattrValid) Mtime() bool

func (SetattrValid) MtimeNow Uses

func (fl SetattrValid) MtimeNow() bool

func (SetattrValid) Size Uses

func (fl SetattrValid) Size() bool

func (SetattrValid) String Uses

func (fl SetattrValid) String() string

func (SetattrValid) Uid Uses

func (fl SetattrValid) Uid() bool

type SetxattrRequest Uses

type SetxattrRequest struct {
    Header `json:"-"`

    // Flags can make the request fail if attribute does/not already
    // exist. Unfortunately, the constants are platform-specific and
    // not exposed by Go1.2. Look for XATTR_CREATE, XATTR_REPLACE.
    //
    // TODO improve this later
    //
    // TODO XATTR_CREATE and exist -> EEXIST
    //
    // TODO XATTR_REPLACE and not exist -> ENODATA
    Flags uint32

    // Deprecated: Not used, OS X remnant.
    Position uint32

    Name  string
    Xattr []byte
}

A SetxattrRequest asks to set an extended attribute associated with a file.

func (*SetxattrRequest) Respond Uses

func (r *SetxattrRequest) Respond()

Respond replies to the request, indicating that the extended attribute was set.

func (*SetxattrRequest) String Uses

func (r *SetxattrRequest) String() string

type StatfsRequest Uses

type StatfsRequest struct {
    Header `json:"-"`
}

A StatfsRequest requests information about the mounted file system.

func (*StatfsRequest) Respond Uses

func (r *StatfsRequest) Respond(resp *StatfsResponse)

Respond replies to the request with the given response.

func (*StatfsRequest) String Uses

func (r *StatfsRequest) String() string

type StatfsResponse Uses

type StatfsResponse struct {
    Blocks  uint64 // Total data blocks in file system.
    Bfree   uint64 // Free blocks in file system.
    Bavail  uint64 // Free blocks in file system if you're not root.
    Files   uint64 // Total files in file system.
    Ffree   uint64 // Free files in file system.
    Bsize   uint32 // Block size
    Namelen uint32 // Maximum file name length?
    Frsize  uint32 // Fragment size, smallest addressable data size in the file system.
}

A StatfsResponse is the response to a StatfsRequest.

func (*StatfsResponse) String Uses

func (r *StatfsResponse) String() string

type SymlinkRequest Uses

type SymlinkRequest struct {
    Header          `json:"-"`
    NewName, Target string
}

A SymlinkRequest is a request to create a symlink making NewName point to Target.

func (*SymlinkRequest) Respond Uses

func (r *SymlinkRequest) Respond(resp *SymlinkResponse)

Respond replies to the request, indicating that the symlink was created.

func (*SymlinkRequest) String Uses

func (r *SymlinkRequest) String() string

type SymlinkResponse Uses

type SymlinkResponse struct {
    LookupResponse
}

A SymlinkResponse is the response to a SymlinkRequest.

func (*SymlinkResponse) String Uses

func (r *SymlinkResponse) String() string

type UnlockRequest Uses

type UnlockRequest LockRequest

UnlockRequest asks to release a lock on a byte range on a node.

UnlockRequests always have Lock.Type == LockUnlock.

See LockRequest. UnlockRequest can be converted to a LockRequest.

func (*UnlockRequest) Respond Uses

func (r *UnlockRequest) Respond()

func (*UnlockRequest) String Uses

func (r *UnlockRequest) String() string

type UnrecognizedRequest Uses

type UnrecognizedRequest struct {
    Header `json:"-"`
    Opcode uint32
}

func (*UnrecognizedRequest) String Uses

func (r *UnrecognizedRequest) String() string

type WriteFlags Uses

type WriteFlags uint32

The WriteFlags are passed in WriteRequest.

const (
    WriteCache WriteFlags = 1 << 0
    // LockOwner field is valid.
    WriteLockOwner WriteFlags = 1 << 1
)

func (WriteFlags) String Uses

func (fl WriteFlags) String() string

type WriteRequest Uses

type WriteRequest struct {
    Header
    Handle    HandleID
    Offset    int64
    Data      []byte
    Flags     WriteFlags
    LockOwner LockOwner
    FileFlags OpenFlags
}

A WriteRequest asks to write to an open file.

func (*WriteRequest) MarshalJSON Uses

func (r *WriteRequest) MarshalJSON() ([]byte, error)

func (*WriteRequest) Respond Uses

func (r *WriteRequest) Respond(resp *WriteResponse)

Respond replies to the request with the given response.

func (*WriteRequest) String Uses

func (r *WriteRequest) String() string

type WriteResponse Uses

type WriteResponse struct {
    Size int
}

A WriteResponse replies to a write indicating how many bytes were written.

func (*WriteResponse) String Uses

func (r *WriteResponse) String() string

Directories

PathSynopsis
examples/clockfsClockfs implements a file system with the current time in a file.
examples/hellofsHellofs implements a simple "hello world" file system.
fs
fs/benchPackage bench contains benchmarks.
fs/fstestutil
fs/fstestutil/record
fs/fstestutil/spawntestPackage spawntest helps write tests that use subprocesses.
fs/fstestutil/spawntest/httpjsonPackage httpjson helps transporting JSON over HTTP.
fuseutil
syscallxPackage syscallx used to provide wrappers for syscalls.

Package fuse imports 17 packages (graph) and is imported by 650 packages. Updated 2020-05-25. Refresh now. Tools for package owners.