Skip to content

Commit 073c3ab

Browse files
lostjeffleMiklos Szeredi
authored andcommitted
Documentation/filesystem/dax: DAX on virtiofs
Record DAX on virtiofs and the semantic difference with that on ext4 and xfs. Signed-off-by: Jeffle Xu <[email protected]> Reviewed-by: Vivek Goyal <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent c3cb6f9 commit 073c3ab

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Documentation/filesystems/dax.rst

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ on it as usual. The `DAX` code currently only supports files with a block
2323
size equal to your kernel's `PAGE_SIZE`, so you may need to specify a block
2424
size when creating the filesystem.
2525

26-
Currently 3 filesystems support `DAX`: ext2, ext4 and xfs. Enabling `DAX` on them
27-
is different.
26+
Currently 4 filesystems support `DAX`: ext2, ext4, xfs and virtiofs.
27+
Enabling `DAX` on them is different.
2828

2929
Enabling DAX on ext2
3030
--------------------
@@ -168,6 +168,22 @@ if the underlying media does not support dax and/or the filesystem is
168168
overridden with a mount option.
169169

170170

171+
Enabling DAX on virtiofs
172+
----------------------------
173+
The semantic of DAX on virtiofs is basically equal to that on ext4 and xfs,
174+
except that when '-o dax=inode' is specified, virtiofs client derives the hint
175+
whether DAX shall be enabled or not from virtiofs server through FUSE protocol,
176+
rather than the persistent `FS_XFLAG_DAX` flag. That is, whether DAX shall be
177+
enabled or not is completely determined by virtiofs server, while virtiofs
178+
server itself may deploy various algorithm making this decision, e.g. depending
179+
on the persistent `FS_XFLAG_DAX` flag on the host.
180+
181+
It is still supported to set or clear persistent `FS_XFLAG_DAX` flag inside
182+
guest, but it is not guaranteed that DAX will be enabled or disabled for
183+
corresponding file then. Users inside guest still need to call statx(2) and
184+
check the statx flag `STATX_ATTR_DAX` to see if DAX is enabled for this file.
185+
186+
171187
Implementation Tips for Block Driver Writers
172188
--------------------------------------------
173189

0 commit comments

Comments
 (0)