Skip to content

Commit 2d1d25d

Browse files
stefanhaRHMiklos Szeredi
authored andcommitted
virtio-fs: add Documentation/filesystems/virtiofs.rst
Add information about the new "virtiofs" file system. Signed-off-by: Stefan Hajnoczi <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent c4bb667 commit 2d1d25d

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed

Documentation/filesystems/index.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,13 @@ filesystem implementations.
3232

3333
journalling
3434
fscrypt
35+
36+
Filesystems
37+
===========
38+
39+
Documentation for filesystem implementations.
40+
41+
.. toctree::
42+
:maxdepth: 2
43+
44+
virtiofs
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
===================================================
4+
virtiofs: virtio-fs host<->guest shared file system
5+
===================================================
6+
7+
- Copyright (C) 2019 Red Hat, Inc.
8+
9+
Introduction
10+
============
11+
The virtiofs file system for Linux implements a driver for the paravirtualized
12+
VIRTIO "virtio-fs" device for guest<->host file system sharing. It allows a
13+
guest to mount a directory that has been exported on the host.
14+
15+
Guests often require access to files residing on the host or remote systems.
16+
Use cases include making files available to new guests during installation,
17+
booting from a root file system located on the host, persistent storage for
18+
stateless or ephemeral guests, and sharing a directory between guests.
19+
20+
Although it is possible to use existing network file systems for some of these
21+
tasks, they require configuration steps that are hard to automate and they
22+
expose the storage network to the guest. The virtio-fs device was designed to
23+
solve these problems by providing file system access without networking.
24+
25+
Furthermore the virtio-fs device takes advantage of the co-location of the
26+
guest and host to increase performance and provide semantics that are not
27+
possible with network file systems.
28+
29+
Usage
30+
=====
31+
Mount file system with tag ``myfs`` on ``/mnt``:
32+
33+
.. code-block:: sh
34+
35+
guest# mount -t virtiofs myfs /mnt
36+
37+
Please see https://virtio-fs.gitlab.io/ for details on how to configure QEMU
38+
and the virtiofsd daemon.
39+
40+
Internals
41+
=========
42+
Since the virtio-fs device uses the FUSE protocol for file system requests, the
43+
virtiofs file system for Linux is integrated closely with the FUSE file system
44+
client. The guest acts as the FUSE client while the host acts as the FUSE
45+
server. The /dev/fuse interface between the kernel and userspace is replaced
46+
with the virtio-fs device interface.
47+
48+
FUSE requests are placed into a virtqueue and processed by the host. The
49+
response portion of the buffer is filled in by the host and the guest handles
50+
the request completion.
51+
52+
Mapping /dev/fuse to virtqueues requires solving differences in semantics
53+
between /dev/fuse and virtqueues. Each time the /dev/fuse device is read, the
54+
FUSE client may choose which request to transfer, making it possible to
55+
prioritize certain requests over others. Virtqueues have queue semantics and
56+
it is not possible to change the order of requests that have been enqueued.
57+
This is especially important if the virtqueue becomes full since it is then
58+
impossible to add high priority requests. In order to address this difference,
59+
the virtio-fs device uses a "hiprio" virtqueue specifically for requests that
60+
have priority over normal requests.

MAINTAINERS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17117,6 +17117,18 @@ S: Supported
1711717117
F: drivers/s390/virtio/
1711817118
F: arch/s390/include/uapi/asm/virtio-ccw.h
1711917119

17120+
VIRTIO FILE SYSTEM
17121+
M: Vivek Goyal <[email protected]>
17122+
M: Stefan Hajnoczi <[email protected]>
17123+
M: Miklos Szeredi <[email protected]>
17124+
17125+
17126+
W: https://virtio-fs.gitlab.io/
17127+
S: Supported
17128+
F: fs/fuse/virtio_fs.c
17129+
F: include/uapi/linux/virtio_fs.h
17130+
F: Documentation/filesystems/virtiofs.rst
17131+
1712017132
VIRTIO GPU DRIVER
1712117133
M: David Airlie <[email protected]>
1712217134
M: Gerd Hoffmann <[email protected]>

0 commit comments

Comments
 (0)