]> git.ipfire.org Git - thirdparty/kernel/linux.git/blame - Documentation/filesystems/fuse-io.txt
riscv: mm: synchronize MMU after pte change
[thirdparty/kernel/linux.git] / Documentation / filesystems / fuse-io.txt
CommitLineData
5ba24197
MS
1Fuse supports the following I/O modes:
2
3- direct-io
4- cached
5 + write-through
6 + writeback-cache
7
8The direct-io mode can be selected with the FOPEN_DIRECT_IO flag in the
9FUSE_OPEN reply.
10
11In direct-io mode the page cache is completely bypassed for reads and writes.
12No read-ahead takes place. Shared mmap is disabled.
13
14In cached mode reads may be satisfied from the page cache, and data may be
15read-ahead by the kernel to fill the cache. The cache is always kept consistent
16after any writes to the file. All mmap modes are supported.
17
18The cached mode has two sub modes controlling how writes are handled. The
19write-through mode is the default and is supported on all kernels. The
20writeback-cache mode may be selected by the FUSE_WRITEBACK_CACHE flag in the
21FUSE_INIT reply.
22
23In write-through mode each write is immediately sent to userspace as one or more
24WRITE requests, as well as updating any cached pages (and caching previously
25uncached, but fully written pages). No READ requests are ever sent for writes,
26so when an uncached page is partially written, the page is discarded.
27
28In writeback-cache mode (enabled by the FUSE_WRITEBACK_CACHE flag) writes go to
29the cache only, which means that the write(2) syscall can often complete very
30fast. Dirty pages are written back implicitly (background writeback or page
31reclaim on memory pressure) or explicitly (invoked by close(2), fsync(2) and
32when the last ref to the file is being released on munmap(2)). This mode
33assumes that all changes to the filesystem go through the FUSE kernel module
34(size and atime/ctime/mtime attributes are kept up-to-date by the kernel), so
35it's generally not suitable for network filesystems. If a partial page is
36written, then the page needs to be first read from userspace. This means, that
37even for files opened for O_WRONLY it is possible that READ requests will be
38generated by the kernel.