libfuse
Data Fields
fuse_conn_info Struct Reference

#include <fuse_common.h>

Data Fields

unsigned proto_major
 
unsigned proto_minor
 
unsigned max_write
 
unsigned max_read
 
unsigned max_readahead
 
unsigned capable
 
unsigned want
 
unsigned max_background
 
unsigned congestion_threshold
 
unsigned time_gran
 
unsigned reserved [22]
 

Detailed Description

Connection information, passed to the ->init() method

Some of the elements are read-write, these can be changed to indicate the value requested by the filesystem. The requested value must usually be smaller than the indicated value.

Definition at line 332 of file fuse_common.h.

Field Documentation

◆ capable

unsigned fuse_conn_info::capable

Capability flags that the kernel supports (read-only)

Definition at line 370 of file fuse_common.h.

◆ congestion_threshold

unsigned fuse_conn_info::congestion_threshold

Kernel congestion threshold parameter. If the number of pending background requests exceeds this number, the FUSE kernel module will mark the filesystem as "congested". This instructs the kernel to expect that queued requests will take some time to complete, and to adjust its algorithms accordingly (e.g. by putting a waiting thread to sleep instead of using a busy-loop).

Definition at line 418 of file fuse_common.h.

◆ max_background

unsigned fuse_conn_info::max_background

Maximum number of pending "background" requests. A background request is any type of request for which the total number is not limited by other means. As of kernel 4.8, only two types of requests fall into this category:

  1. Read-ahead requests
  2. Asychronous direct I/O requests

Read-ahead requests are generated (if max_readahead is non-zero) by the kernel to preemptively fill its caches when it anticipates that userspace will soon read more data.

Asynchronous direct I/O requests are generated if FUSE_CAP_ASYNC_DIO is enabled and userspace submits a large direct I/O request. In this case the kernel will internally split it up into multiple smaller requests and submit them to the filesystem concurrently.

Note that the following requests are not background requests: writeback requests (limited by the kernel's flusher algorithm), regular (i.e., synchronous and buffered) userspace read/write requests (limited to one per thread), asynchronous read requests (Linux's io_submit(2) call actually blocks, so these are also limited to one per thread).

Definition at line 408 of file fuse_common.h.

◆ max_read

unsigned fuse_conn_info::max_read

Maximum size of read requests. A value of zero indicates no limit. However, even if the filesystem does not specify a limit, the maximum size of read requests will still be limited by the kernel.

NOTE: For the time being, the maximum size of read requests must be set both here and passed to fuse_session_new() using the -o max_read=<n> mount option. At some point in the future, specifying the mount option will no longer be necessary.

Definition at line 360 of file fuse_common.h.

◆ max_readahead

unsigned fuse_conn_info::max_readahead

Maximum readahead

Definition at line 365 of file fuse_common.h.

◆ max_write

unsigned fuse_conn_info::max_write

Maximum size of the write buffer

Definition at line 346 of file fuse_common.h.

◆ proto_major

unsigned fuse_conn_info::proto_major

Major version of the protocol (read-only)

Definition at line 336 of file fuse_common.h.

◆ proto_minor

unsigned fuse_conn_info::proto_minor

Minor version of the protocol (read-only)

Definition at line 341 of file fuse_common.h.

◆ reserved

unsigned fuse_conn_info::reserved

For future use.

Definition at line 440 of file fuse_common.h.

◆ time_gran

unsigned fuse_conn_info::time_gran

When FUSE_CAP_WRITEBACK_CACHE is enabled, the kernel is responsible for updating mtime and ctime when write requests are received. The updated values are passed to the filesystem with setattr() requests. However, if the filesystem does not support the full resolution of the kernel timestamps (nanoseconds), the mtime and ctime values used by kernel and filesystem will differ (and result in an apparent change of times after a cache flush).

To prevent this problem, this variable can be used to inform the kernel about the timestamp granularity supported by the file-system. The value should be power of 10. The default is 1, i.e. full nano-second resolution. Filesystems supporting only second resolution should set this to 1000000000.

Definition at line 435 of file fuse_common.h.

◆ want

unsigned fuse_conn_info::want

Capability flags that the filesystem wants to enable.

libfuse attempts to initialize this field with reasonable default values before calling the init() handler.

Definition at line 378 of file fuse_common.h.


The documentation for this struct was generated from the following file: