]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fusefs: rewrite vop_getpages and vop_putpages
authorasomers <asomers@FreeBSD.org>
Tue, 25 Jun 2019 17:24:43 +0000 (17:24 +0000)
committerasomers <asomers@FreeBSD.org>
Tue, 25 Jun 2019 17:24:43 +0000 (17:24 +0000)
commit5c38f956316b6bac3b6839d459af7db23f6002ec
tree9605f046a53b0b17587aca84aecaebe1a16e3cee
parentf133355dc103680a0b303a76ded853ddeeec6516
fusefs: rewrite vop_getpages and vop_putpages

Use the standard facilities for getpages and putpages instead of bespoke
implementations that don't work well with the writeback cache.  This has
several corollaries:

* Change the way we handle short reads _again_.  vfs_bio_getpages doesn't
  provide any way to handle unexpected short reads.  Plus, I found some more
  lock-order problems.  So now when the short read is detected we'll just
  clear the vnode's attribute cache, forcing the file size to be requeried
  the next time it's needed.  VOP_GETPAGES doesn't have any way to indicate
  a short read to the "caller", so we just bzero the rest of the page
  whenever a short read happens.

* Change the way we decide when to set the FUSE_WRITE_CACHE bit.  We now set
  it for clustered writes even when the writeback cache is not in use.

Sponsored by:   The FreeBSD Foundation
sys/fs/fuse/fuse_io.c
sys/fs/fuse/fuse_io.h
sys/fs/fuse/fuse_vnops.c
tests/sys/fs/fusefs/read.cc
tests/sys/fs/fusefs/write.cc