linux/fs/fscache
David Howells 16f2f4e679 nfs: Implement cache I/O by accessing the cache directly
Move NFS to using fscache DIO API instead of the old upstream I/O API as
that has been removed.  This is a stopgap solution as the intention is that
at sometime in the future, the cache will move to using larger blocks and
won't be able to store individual pages in order to deal with the potential
for data corruption due to the backing filesystem being able insert/remove
bridging blocks of zeros into its extent list[1].

NFS then reads and writes cache pages synchronously and one page at a time.

The preferred change would be to use the netfs lib, but the new I/O API can
be used directly.  It's just that as the cache now needs to track data for
itself, caching blocks may exceed page size...

This code is somewhat borrowed from my "fallback I/O" patchset[2].

Changes
=======
ver #3:
 - Restore lost =n fallback for nfs_fscache_release_page()[2].

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Dave Wysochanski <dwysocha@redhat.com>
Acked-by: Jeff Layton <jlayton@kernel.org>
cc: Trond Myklebust <trond.myklebust@hammerspace.com>
cc: Anna Schumaker <anna.schumaker@netapp.com>
cc: linux-nfs@vger.kernel.org
cc: linux-cachefs@redhat.com
Link: https://lore.kernel.org/r/YO17ZNOcq+9PajfQ@mit.edu [1]
Link: https://lore.kernel.org/r/202112100957.2oEDT20W-lkp@intel.com/ [2]
Link: https://lore.kernel.org/r/163189108292.2509237.12615909591150927232.stgit@warthog.procyon.org.uk/ [2]
Link: https://lore.kernel.org/r/163906981318.143852.17220018647843475985.stgit@warthog.procyon.org.uk/ # v2
Link: https://lore.kernel.org/r/163967184451.1823006.6450645559828329590.stgit@warthog.procyon.org.uk/ # v3
Link: https://lore.kernel.org/r/164021577632.640689.11069627070150063812.stgit@warthog.procyon.org.uk/ # v4
2022-01-10 11:53:25 +00:00
..
cache.c fscache: Count data storage objects in a cache 2022-01-07 09:22:19 +00:00
cookie.c fscache: Implement cookie invalidation 2022-01-07 09:22:19 +00:00
internal.h fscache: Provide a function to resize a cookie 2022-01-07 13:40:33 +00:00
io.c nfs: Implement cache I/O by accessing the cache directly 2022-01-10 11:53:25 +00:00
Kconfig fscache: Introduce new driver 2022-01-07 09:22:19 +00:00
main.c fscache: Implement cookie-level access helpers 2022-01-07 09:22:19 +00:00
Makefile fscache: Provide a means to begin an operation 2022-01-07 09:22:19 +00:00
proc.c fscache: Implement cookie registration 2022-01-07 09:22:19 +00:00
stats.c fscache, cachefiles: Display stat of culling events 2022-01-07 13:43:18 +00:00
volume.c fscache, cachefiles: Store the volume coherency data 2022-01-07 13:43:03 +00:00