2016-12-10 07:20:18 +00:00
|
|
|
.\" Copyright (c) 2016 Julia Computing Inc, Keno Fischer
|
|
|
|
.\" Description based on include/uapi/fuse.h and code in fs/fuse
|
|
|
|
.\"
|
|
|
|
.\" %%%LICENSE_START(VERBATIM)
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
|
|
|
.\"
|
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
|
|
|
.\"
|
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\" %%%LICENSE_END
|
|
|
|
.\"
|
|
|
|
.TH FUSE 4 2016-12-10 "Linux" "Linux Programmer's Manual"
|
|
|
|
.SH NAME
|
|
|
|
/dev/fuse \- Filesystem in Userspace (FUSE) device
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <linux/fuse.h>
|
|
|
|
.nf
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
|
|
|
This device is the primary interface between the FUSE filesystem driver
|
2016-12-10 12:25:06 +00:00
|
|
|
and a user-space process wishing to provide the filesystem (referred to
|
2016-12-10 07:20:18 +00:00
|
|
|
in the rest of this manual page as the
|
2016-12-10 12:25:06 +00:00
|
|
|
.IR "filesystem daemon" ).
|
2016-12-10 07:20:18 +00:00
|
|
|
This manual page is intended for those
|
2016-12-10 12:16:36 +00:00
|
|
|
interested in understanding the kernel interface itself.
|
|
|
|
Those implementing a FUSE filesystem may wish to make use of
|
2016-12-10 12:25:06 +00:00
|
|
|
a user-space library such as
|
|
|
|
.I libfuse
|
|
|
|
that abstracts away the low-level interface.
|
2016-12-10 07:20:18 +00:00
|
|
|
|
|
|
|
At its core, FUSE is a simple client-server protocol, in which the Linux
|
2016-12-10 12:16:36 +00:00
|
|
|
kernel is the client and the daemon is the server.
|
2016-12-10 12:25:06 +00:00
|
|
|
After obtaining a file descriptor for this device, the daemon may
|
2016-12-10 07:20:18 +00:00
|
|
|
.BR read (2)
|
|
|
|
requests from that file descriptor and is expected to
|
|
|
|
.BR write (2)
|
2016-12-10 12:25:06 +00:00
|
|
|
back its replies.
|
|
|
|
It is important to note that a file descriptor is
|
|
|
|
associated with a unique FUSE filesystem.
|
2016-12-10 12:16:36 +00:00
|
|
|
In particular, opening a second copy of this device,
|
|
|
|
will not allow access to resources created
|
2016-12-10 07:20:18 +00:00
|
|
|
through the first file descriptor (and vice versa).
|
2016-12-10 12:25:06 +00:00
|
|
|
.\"
|
2016-12-10 07:20:18 +00:00
|
|
|
.SS The basic protocol
|
|
|
|
Every message that is read by the daemon begins with a header described by
|
2016-12-10 12:25:06 +00:00
|
|
|
the following structure:
|
2016-12-10 07:20:18 +00:00
|
|
|
|
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
struct fuse_in_header {
|
2016-12-10 12:25:06 +00:00
|
|
|
uint32_t len; /* Total length of the data,
|
|
|
|
including this header */
|
|
|
|
uint32_t opcode; /* The kind of operation (see below) */
|
|
|
|
uint64_t unique; /* A unique identifier for this request */
|
|
|
|
uint64_t nodeid; /* ID of the filesystem object
|
|
|
|
being operated on */
|
|
|
|
uint32_t uid; /* UID of the requesting process */
|
|
|
|
uint32_t gid; /* GID of the requesting process */
|
|
|
|
uint32_t pid; /* PID of the requesting process */
|
|
|
|
uint32_t padding;
|
2016-12-10 07:20:18 +00:00
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
2016-12-10 12:25:06 +00:00
|
|
|
The header is followed by a variable-length data portion
|
|
|
|
(which may be empty) specific to the requested operation
|
2016-12-10 07:20:18 +00:00
|
|
|
(the requested operation is indicated by
|
2016-12-10 12:25:06 +00:00
|
|
|
.IR opcode ).
|
2016-12-10 07:20:18 +00:00
|
|
|
|
2016-12-10 12:16:36 +00:00
|
|
|
The daemon should then process the request and if applicable send
|
2016-12-10 12:25:06 +00:00
|
|
|
a reply (almost all operations require a reply; if they do not,
|
2016-12-10 12:16:36 +00:00
|
|
|
this is documented below), by performing a
|
2016-12-10 12:25:06 +00:00
|
|
|
.BR write (2)
|
2016-12-10 12:16:36 +00:00
|
|
|
to the file descriptor.
|
|
|
|
All replies must start with the following header:
|
2016-12-10 07:20:18 +00:00
|
|
|
|
|
|
|
.in +4n
|
|
|
|
.nf
|
2016-12-10 12:25:06 +00:00
|
|
|
struct fuse_out_header {
|
|
|
|
uint32_t len; /* Total length of data written to
|
|
|
|
the file descriptor */
|
|
|
|
int32_t error; /* Any error that occurred (0 if none) */
|
|
|
|
uint64_t unique; /* The value from the
|
|
|
|
corresponding request */
|
|
|
|
};
|
2016-12-10 07:20:18 +00:00
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
2016-12-10 12:25:06 +00:00
|
|
|
This header is also followed by (potentially empty) variable-sized
|
|
|
|
data depending on the executed request.
|
|
|
|
However, if the reply is an error reply (i.e.,
|
|
|
|
.I error
|
|
|
|
is set),
|
2016-12-10 07:20:18 +00:00
|
|
|
then no further payload data should be sent, independent of the request.
|
2016-12-10 12:25:06 +00:00
|
|
|
.\"
|
2016-12-10 07:20:18 +00:00
|
|
|
.SS Exchanged messages
|
2016-12-10 12:16:36 +00:00
|
|
|
This section should contain documentation for each of the messages
|
|
|
|
in the protocol.
|
|
|
|
This manual page is currently incomplete,
|
|
|
|
so not all messages are documented.
|
|
|
|
For each message, first the struct sent by the kernel is given,
|
|
|
|
followed by a description of the semantics of the message.
|
2016-12-10 07:20:18 +00:00
|
|
|
.TP
|
|
|
|
.BR FUSE_INIT " ( 25 )"
|
|
|
|
|
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
struct fuse_init_in {
|
2016-12-10 12:25:06 +00:00
|
|
|
uint32_t major;
|
|
|
|
uint32_t minor;
|
|
|
|
uint32_t max_readahead; /* Since protocol v7.6 */
|
|
|
|
uint32_t flags; /* Since protocol v7.6 */
|
2016-12-10 07:20:18 +00:00
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
2016-12-10 12:16:36 +00:00
|
|
|
This is the first request sent by the kernel to the daemon.
|
2016-12-10 12:25:06 +00:00
|
|
|
It is used to negotiate the protocol version and other filesystem parameters.
|
2016-12-10 12:16:36 +00:00
|
|
|
Note that the protocol version may affect the layout of any structure
|
2016-12-10 13:32:18 +00:00
|
|
|
in the protocol (including this structure).
|
2016-12-10 12:16:36 +00:00
|
|
|
The daemon must thus remember the negotiated version
|
|
|
|
and flags for each session.
|
|
|
|
As of the writing of this man page,
|
|
|
|
the highest supported kernel protocol version is
|
2016-12-10 12:25:06 +00:00
|
|
|
.IR 7.26 .
|
2016-12-10 07:20:18 +00:00
|
|
|
|
|
|
|
Users should be aware that the descriptions in this manual page
|
|
|
|
may be incomplete or incorrect for older or more recent protocol versions.
|
|
|
|
|
2016-12-10 12:25:06 +00:00
|
|
|
The reply for this request has the following format:
|
|
|
|
|
2016-12-10 07:20:18 +00:00
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
struct fuse_init_out {
|
2016-12-10 12:25:06 +00:00
|
|
|
uint32_t major;
|
|
|
|
uint32_t minor;
|
|
|
|
uint32_t max_readahead; /* Since v7.6 */
|
|
|
|
uint32_t flags; /* Since v7.6; some flags bits
|
|
|
|
were introduced later */
|
|
|
|
uint16_t max_background; /* Since v7.13 */
|
|
|
|
uint16_t congestion_threshold; /* Since v7.13 */
|
|
|
|
uint32_t max_write; /* Since v7.5 */
|
|
|
|
uint32_t time_gran; /* Since v7.6 */
|
|
|
|
uint32_t unused[9];
|
2016-12-10 07:20:18 +00:00
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
2016-12-10 12:25:06 +00:00
|
|
|
If the major version supported by the kernel is larger than that supported
|
2016-12-10 07:20:18 +00:00
|
|
|
by the daemon, the reply shall consist of only
|
|
|
|
.I uint32_t major
|
2016-12-10 12:16:36 +00:00
|
|
|
(following the usual header),
|
|
|
|
indicating the largest major version supported by the daemon.
|
|
|
|
The kernel will then issue a new
|
2016-12-10 12:25:06 +00:00
|
|
|
.B FUSE_INIT
|
2016-12-10 12:16:36 +00:00
|
|
|
request conforming to the older version.
|
|
|
|
In the reverse case, the daemon should
|
2016-12-10 07:20:18 +00:00
|
|
|
quietly fall back to the kernel's major version.
|
|
|
|
|
2016-12-10 12:16:36 +00:00
|
|
|
The negotiated minor version is considered to be the minimum
|
|
|
|
of the minor versions provided by the daemon and the kernel and
|
|
|
|
both parties should use the protocol corresponding to said minor version.
|
2016-12-10 07:20:18 +00:00
|
|
|
.TP
|
|
|
|
.BR FUSE_GETATTR " ( 3 )"
|
2016-12-10 13:35:41 +00:00
|
|
|
.\" FIXME It looks like this is for implementing a stat(2) type of
|
|
|
|
.\" operation. There needs to be a sentence here describing what
|
|
|
|
.\" this option does.
|
|
|
|
|
2016-12-10 07:20:18 +00:00
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
struct fuse_getattr_in {
|
2016-12-10 12:25:06 +00:00
|
|
|
uint32_t getattr_flags;
|
|
|
|
uint32_t dummy;
|
|
|
|
uint64_t fh; /* Set only if
|
|
|
|
(getattr_flags & FUSE_GETATTR_FH)
|
2016-12-10 07:20:18 +00:00
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
|
|
|
As usual, the filesystem object operated on is indicated by
|
2016-12-10 12:25:06 +00:00
|
|
|
.IR header\->nodeid .
|
2016-12-10 07:20:18 +00:00
|
|
|
The daemon should compute the attributes
|
|
|
|
of this object and reply with the following message:
|
|
|
|
.in +4n
|
2016-12-10 12:25:06 +00:00
|
|
|
|
2016-12-10 07:20:18 +00:00
|
|
|
.nf
|
|
|
|
struct fuse_attr {
|
2016-12-10 12:25:06 +00:00
|
|
|
uint64_t ino;
|
|
|
|
uint64_t size;
|
|
|
|
uint64_t blocks;
|
|
|
|
uint64_t atime;
|
|
|
|
uint64_t mtime;
|
|
|
|
uint64_t ctime;
|
|
|
|
uint32_t atimensec;
|
|
|
|
uint32_t mtimensec;
|
|
|
|
uint32_t ctimensec;
|
|
|
|
uint32_t mode;
|
|
|
|
uint32_t nlink;
|
|
|
|
uint32_t uid;
|
|
|
|
uint32_t gid;
|
|
|
|
uint32_t rdev;
|
|
|
|
uint32_t blksize;
|
|
|
|
uint32_t padding;
|
2016-12-10 07:20:18 +00:00
|
|
|
};
|
2016-12-10 12:25:06 +00:00
|
|
|
|
2016-12-10 07:20:18 +00:00
|
|
|
struct fuse_attr_out {
|
|
|
|
/* Attribute cache duration (seconds + nanoseconds) */
|
2016-12-10 12:25:06 +00:00
|
|
|
uint64_t attr_valid;
|
|
|
|
uint32_t attr_valid_nsec;
|
|
|
|
uint32_t dummy;
|
2016-12-10 07:20:18 +00:00
|
|
|
struct fuse_attr attr;
|
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
|
|
|
The fields of
|
|
|
|
.I struct fuse_attr
|
2016-12-10 12:16:36 +00:00
|
|
|
describe the attributes of the required file.
|
|
|
|
For the interpretation of these fields, see
|
2016-12-10 12:25:06 +00:00
|
|
|
.BR stat (2).
|
2016-12-10 07:20:18 +00:00
|
|
|
.TP
|
|
|
|
.BR FUSE_ACCESS " ( 34 )"
|
|
|
|
|
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
struct fuse_access_in {
|
2016-12-10 12:25:06 +00:00
|
|
|
uint32_t mask;
|
|
|
|
uint32_t padding;
|
2016-12-10 07:20:18 +00:00
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
|
|
|
If the
|
|
|
|
.I default_permissions
|
2016-12-10 12:16:36 +00:00
|
|
|
mount options is not used, this request may be used for permissions checking.
|
|
|
|
No reply data is expected, but errors may be indicated
|
2016-12-10 07:20:18 +00:00
|
|
|
as usual in the reply header (in particular, access denied errors
|
|
|
|
may be indicated, by setting such field to
|
2016-12-10 13:36:39 +00:00
|
|
|
.\" FIXME What does "such field" mean? The 'error' field?
|
2016-12-10 12:25:06 +00:00
|
|
|
.BR \-EACCES ).
|
2016-12-10 07:20:18 +00:00
|
|
|
.TP
|
|
|
|
.BR FUSE_OPEN " ( 14 ) and " FUSE_OPENDIR " ( 34 )"
|
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
struct fuse_open_in {
|
2016-12-10 12:25:06 +00:00
|
|
|
uint32_t flags; /* The flags that were passed
|
|
|
|
to the open(2) */
|
|
|
|
uint32_t unused;
|
2016-12-10 07:20:18 +00:00
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
|
|
|
The requested operation is to open the node indicated by
|
2016-12-10 12:25:06 +00:00
|
|
|
.IR header\->nodeid .
|
|
|
|
The exact semantics of what this means will depend on the
|
2016-12-10 12:16:36 +00:00
|
|
|
filesystem being implemented.
|
|
|
|
However, at the very least the
|
2016-12-10 12:25:06 +00:00
|
|
|
filesystem should validate that the requested
|
2016-12-10 07:20:18 +00:00
|
|
|
.I flags
|
2016-12-10 12:25:06 +00:00
|
|
|
are valid for the indicated resource and then send a reply with the
|
|
|
|
following format:
|
2016-12-10 07:20:18 +00:00
|
|
|
|
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
|
|
|
|
struct fuse_open_out {
|
2016-12-10 12:25:06 +00:00
|
|
|
uint64_t fh;
|
|
|
|
uint32_t open_flags;
|
|
|
|
uint32_t padding;
|
2016-12-10 07:20:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
2016-12-10 12:25:06 +00:00
|
|
|
The
|
2016-12-10 07:20:18 +00:00
|
|
|
.I fh
|
2016-12-10 12:25:06 +00:00
|
|
|
field is an opaque identifier that the kernel will use to refer
|
|
|
|
to this resource
|
|
|
|
The
|
|
|
|
.I open_flags
|
|
|
|
field is a bit mask of any number of
|
2016-12-10 07:20:18 +00:00
|
|
|
.B FOPEN_*
|
|
|
|
flags, which indicate properties of this file handle to the kernel.
|
|
|
|
.TP
|
|
|
|
.BR FUSE_READ " ( 15 ) and " FUSE_READDIR " ( 28 )"
|
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
|
|
|
|
struct fuse_read_in {
|
2016-12-10 12:25:06 +00:00
|
|
|
uint64_t fh;
|
|
|
|
uint64_t offset;
|
|
|
|
uint32_t size;
|
|
|
|
uint32_t read_flags;
|
|
|
|
uint64_t lock_owner;
|
|
|
|
uint32_t flags;
|
|
|
|
uint32_t padding;
|
2016-12-10 07:20:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
2016-12-10 12:25:06 +00:00
|
|
|
The requested action is to read up to
|
2016-12-10 07:20:18 +00:00
|
|
|
.I size
|
|
|
|
bytes of the file or directory, starting at
|
2016-12-10 12:25:06 +00:00
|
|
|
.IR offset .
|
|
|
|
The bytes should be returned directly following the out header,
|
2016-12-10 07:20:18 +00:00
|
|
|
with no further special out structure.
|
|
|
|
.TP
|
|
|
|
.BR FUSE_INTERRUPT " ( 36 )"
|
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
struct fuse_interrupt_in {
|
2016-12-10 12:25:06 +00:00
|
|
|
uint64_t unique;
|
2016-12-10 07:20:18 +00:00
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
|
|
|
The requested action is to cancel the pending operation indicated by
|
2016-12-10 12:25:06 +00:00
|
|
|
.IR unique .
|
2016-12-10 12:16:36 +00:00
|
|
|
This request requires no response.
|
|
|
|
However, receipt of this message does
|
|
|
|
not by itself cancel the indicated operation.
|
2016-12-10 12:25:06 +00:00
|
|
|
The kernel will still expect a reply to said operation (e.g., an
|
|
|
|
.I EINTR
|
|
|
|
error or a short read).
|
2016-12-10 12:16:36 +00:00
|
|
|
At most one
|
2016-12-10 07:20:18 +00:00
|
|
|
.B FUSE_INTERRUPT
|
2016-12-10 12:16:36 +00:00
|
|
|
request will be issued for a given operation.
|
|
|
|
After issuing said operation,
|
2016-12-10 12:25:06 +00:00
|
|
|
the kernel will wait uninterruptibly for completion of the indicated request.
|
2016-12-10 07:20:18 +00:00
|
|
|
.TP
|
|
|
|
.BR FUSE_LOOKUP " ( 1 )"
|
|
|
|
Directly following the header is a filename to be looked up in the directory
|
|
|
|
indicated by
|
2016-12-10 12:25:06 +00:00
|
|
|
.IR header\->nodeid .
|
|
|
|
The expected reply is of the form:
|
2016-12-10 07:20:18 +00:00
|
|
|
|
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
struct fuse_entry_out {
|
2016-12-10 13:29:44 +00:00
|
|
|
uint64_t nodeid; /* Inode ID */
|
|
|
|
uint64_t generation; /* Inode generation */
|
2016-12-10 12:25:06 +00:00
|
|
|
uint64_t entry_valid;
|
|
|
|
uint64_t attr_valid;
|
|
|
|
uint32_t entry_valid_nsec;
|
|
|
|
uint32_t attr_valid_nsec;
|
2016-12-10 07:20:18 +00:00
|
|
|
struct fuse_attr attr;
|
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
2016-12-10 13:28:50 +00:00
|
|
|
The combination of
|
|
|
|
.I nodeid
|
|
|
|
and
|
|
|
|
.I generation
|
|
|
|
must be unique for the filesystem's lifetime.
|
|
|
|
|
2016-12-10 07:20:18 +00:00
|
|
|
The interpretation of timeouts and
|
|
|
|
.I attr
|
2016-12-10 12:25:06 +00:00
|
|
|
is as for
|
|
|
|
.BR FUSE_GETATTR .
|
2016-12-10 07:20:18 +00:00
|
|
|
.TP
|
|
|
|
.BR FUSE_FLUSH " ( 36 )"
|
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
struct fuse_flush_in {
|
2016-12-10 12:25:06 +00:00
|
|
|
uint64_t fh;
|
|
|
|
uint32_t unused;
|
|
|
|
uint32_t padding;
|
|
|
|
uint64_t lock_owner;
|
2016-12-10 07:20:18 +00:00
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
|
|
|
The requested action is to flush any pending changes to the indicated
|
2016-12-10 12:16:36 +00:00
|
|
|
file handle.
|
|
|
|
No reply data is expected.
|
|
|
|
However, an empty reply message
|
2016-12-10 07:20:18 +00:00
|
|
|
still needs to be issued once the flush operation is complete.
|
|
|
|
.TP
|
|
|
|
.BR FUSE_RELEASE " ( 18 ) and " FUSE_RELEASEDIR " ( 29 )"
|
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
struct fuse_release_in {
|
2016-12-10 12:25:06 +00:00
|
|
|
uint64_t fh;
|
|
|
|
uint32_t flags;
|
|
|
|
uint32_t release_flags;
|
|
|
|
uint64_t lock_owner;
|
2016-12-10 07:20:18 +00:00
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
2016-12-10 12:25:06 +00:00
|
|
|
These are the converse of
|
2016-12-10 07:20:18 +00:00
|
|
|
.BR FUSE_OPEN
|
2016-12-10 12:25:06 +00:00
|
|
|
and
|
2016-12-10 07:20:18 +00:00
|
|
|
.BR FUSE_OPENDIR
|
2016-12-10 12:16:36 +00:00
|
|
|
respectively.
|
|
|
|
The daemon may now free any resources associated with the
|
2016-12-10 07:20:18 +00:00
|
|
|
file handle
|
|
|
|
.I fh
|
2016-12-10 12:16:36 +00:00
|
|
|
as the kernel will no longer refer to it.
|
2016-12-10 12:25:06 +00:00
|
|
|
There is no reply data associated with this request,
|
2016-12-10 12:16:36 +00:00
|
|
|
but a reply still needs to be issued once the request has
|
2016-12-10 07:20:18 +00:00
|
|
|
been completely processed.
|
|
|
|
.TP
|
|
|
|
.BR FUSE_STATFS " ( 17 )"
|
|
|
|
This operation implements
|
2016-12-10 12:25:06 +00:00
|
|
|
.BR statfs (2)
|
|
|
|
for this filesystem.
|
2016-12-10 12:16:36 +00:00
|
|
|
There is no input data associated with this request.
|
2016-12-10 07:20:18 +00:00
|
|
|
The expected reply data has the following structure:
|
2016-12-10 12:25:06 +00:00
|
|
|
|
2016-12-10 07:20:18 +00:00
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
struct fuse_kstatfs {
|
2016-12-10 12:25:06 +00:00
|
|
|
uint64_t blocks;
|
|
|
|
uint64_t bfree;
|
|
|
|
uint64_t bavail;
|
|
|
|
uint64_t files;
|
|
|
|
uint64_t ffree;
|
|
|
|
uint32_t bsize;
|
|
|
|
uint32_t namelen;
|
|
|
|
uint32_t frsize;
|
|
|
|
uint32_t padding;
|
|
|
|
uint32_t spare[6];
|
2016-12-10 07:20:18 +00:00
|
|
|
};
|
2016-12-10 12:25:06 +00:00
|
|
|
|
2016-12-10 07:20:18 +00:00
|
|
|
struct fuse_statfs_out {
|
|
|
|
struct fuse_kstatfs st;
|
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
|
|
|
For the interpretation of these fields, see
|
2016-12-10 12:25:06 +00:00
|
|
|
.BR statfs (2).
|
2016-12-10 07:20:18 +00:00
|
|
|
.SH ERRORS
|
2016-12-10 12:25:06 +00:00
|
|
|
.TP
|
2016-12-10 07:20:18 +00:00
|
|
|
.B EPERM
|
|
|
|
Returned from operations on a
|
|
|
|
.I /dev/fuse
|
2016-12-10 12:25:06 +00:00
|
|
|
file descriptor that has not been mounted.
|
|
|
|
.TP
|
2016-12-10 07:20:18 +00:00
|
|
|
.B EIO
|
|
|
|
Returned from
|
2016-12-10 12:25:06 +00:00
|
|
|
.BR read (2)
|
2016-12-10 07:20:18 +00:00
|
|
|
operations when the kernel's request is too large for the provided buffer.
|
|
|
|
|
|
|
|
.IR Note :
|
|
|
|
There are various ways in which incorrect use of these interfaces can cause
|
|
|
|
operations on the provided filesystem's files and directories to fail with
|
2016-12-10 12:25:06 +00:00
|
|
|
.BR EIO .
|
|
|
|
Among the possible incorrect uses are
|
|
|
|
.IP * 3
|
|
|
|
changing
|
2016-12-10 07:20:18 +00:00
|
|
|
.I mode & S_IFMT
|
2016-12-10 12:25:06 +00:00
|
|
|
for an inode that has previously been reported to the kernel; or
|
|
|
|
.IP *
|
|
|
|
giving replies to the kernel that are shorter than what the kernel expected.
|
|
|
|
.TP
|
2016-12-10 07:20:18 +00:00
|
|
|
.B EINVAL
|
|
|
|
Returned from
|
2016-12-10 12:25:06 +00:00
|
|
|
.BR write (2)
|
2016-12-10 12:16:36 +00:00
|
|
|
if validation of the reply failed.
|
2016-12-10 13:30:43 +00:00
|
|
|
Not all mistakes in replies will be caught by this validation.
|
2016-12-10 12:16:36 +00:00
|
|
|
However, basic mistakes, such as short replies or an incorrect
|
2016-12-10 07:20:18 +00:00
|
|
|
.I unique
|
2016-12-10 13:30:43 +00:00
|
|
|
value, are detected.
|
2016-12-10 12:25:06 +00:00
|
|
|
.TP
|
2016-12-10 07:20:18 +00:00
|
|
|
.B E2BIG
|
|
|
|
Returned from
|
2016-12-10 12:25:06 +00:00
|
|
|
.BR read (2)
|
2016-12-10 07:20:18 +00:00
|
|
|
operations when the kernel's request is too large for the provided buffer
|
2016-12-10 12:25:06 +00:00
|
|
|
and the request was
|
|
|
|
.BR FUSE_SETXATTR .
|
|
|
|
.TP
|
2016-12-10 07:20:18 +00:00
|
|
|
.B ENODEV
|
2016-12-10 13:37:48 +00:00
|
|
|
Returned from
|
|
|
|
.BR read (2)
|
|
|
|
and
|
|
|
|
.BR write (2)
|
|
|
|
if the FUSE filesystem was unmounted.
|