]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fusefs: implement protocol 7.23's FUSE_WRITEBACK_CACHE option
authorasomers <asomers@FreeBSD.org>
Wed, 26 Jun 2019 17:32:31 +0000 (17:32 +0000)
committerasomers <asomers@FreeBSD.org>
Wed, 26 Jun 2019 17:32:31 +0000 (17:32 +0000)
commit014c4a07dfb3a5918d85cd2ec484735b60cd0e80
tree865ae5cad66e0284ebb3eebad4962d1467682a17
parent2430baeee2a3b60f7d21b2a2056011cdb11c36fa
fusefs: implement protocol 7.23's FUSE_WRITEBACK_CACHE option

As of protocol 7.23, fuse file systems can specify their cache behavior on a
per-mountpoint basis.  If they set FUSE_WRITEBACK_CACHE in
fuse_init_out.flags, then they'll get the writeback cache.  If not, then
they'll get the writethrough cache.  If they set FOPEN_DIRECT_IO in every
FUSE_OPEN response, then they'll get no cache at all.

The old vfs.fusefs.data_cache_mode sysctl is ignored for servers that use
protocol 7.23 or later.  However, it's retained for older servers,
especially for those running in jails that lack access to the new protocol.

This commit also fixes two other minor test bugs:
* WriteCluster:SetUp was using an uninitialized variable.
* Read.direct_io_pread wasn't verifying that the cache was actually
  bypassed.

Sponsored by: The FreeBSD Foundation
share/man/man5/fusefs.5
sys/fs/fuse/fuse_internal.c
sys/fs/fuse/fuse_io.c
sys/fs/fuse/fuse_ipc.h
sys/fs/fuse/fuse_node.c
tests/sys/fs/fusefs/io.cc
tests/sys/fs/fusefs/notify.cc
tests/sys/fs/fusefs/read.cc
tests/sys/fs/fusefs/setattr.cc
tests/sys/fs/fusefs/write.cc