linux-stable/fs/afs
David Howells 523d27cda1 afs: Convert afs to use the new fscache API
Change the afs filesystem to support the new afs driver.

The following changes have been made:

 (1) The fscache_netfs struct is no more, and there's no need to register
     the filesystem as a whole.  There's also no longer a cell cookie.

 (2) The volume cookie is now an fscache_volume cookie, allocated with
     fscache_acquire_volume().  This function takes three parameters: a
     string representing the "volume" in the index, a string naming the
     cache to use (or NULL) and a u64 that conveys coherency metadata for
     the volume.

     For afs, I've made it render the volume name string as:

        "afs,<cell>,<volume_id>"

     and the coherency data is currently 0.

 (3) The fscache_cookie_def is no more and needed information is passed
     directly to fscache_acquire_cookie().  The cache no longer calls back
     into the filesystem, but rather metadata changes are indicated at
     other times.

     fscache_acquire_cookie() is passed the same keying and coherency
     information as before, except that these are now stored in big endian
     form instead of cpu endian.  This makes the cache more copyable.

 (4) fscache_use_cookie() and fscache_unuse_cookie() are called when a file
     is opened or closed to prevent a cache file from being culled and to
     keep resources to hand that are needed to do I/O.

     fscache_use_cookie() is given an indication if the cache is likely to
     be modified locally (e.g. the file is open for writing).

     fscache_unuse_cookie() is given a coherency update if we had the file
     open for writing and will update that.

 (5) fscache_invalidate() is now given uptodate auxiliary data and a file
     size.  It can also take a flag to indicate if this was due to a DIO
     write.  This is wrapped into afs_fscache_invalidate() now for
     convenience.

 (6) fscache_resize() now gets called from the finalisation of
     afs_setattr(), and afs_setattr() does use/unuse of the cookie around
     the call to support this.

 (7) fscache_note_page_release() is called from afs_release_page().

 (8) Use a killable wait in nfs_vm_page_mkwrite() when waiting for
     PG_fscache to be cleared.

Render the parts of the cookie key for an afs inode cookie as big endian.

Changes
=======
ver #2:
 - Use gfpflags_allow_blocking() rather than using flag directly.
 - fscache_acquire_volume() now returns errors.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Jeff Layton <jlayton@kernel.org>
Tested-by: kafs-testing@auristor.com
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
cc: linux-cachefs@redhat.com
Link: https://lore.kernel.org/r/163819661382.215744.1485608824741611837.stgit@warthog.procyon.org.uk/ # v1
Link: https://lore.kernel.org/r/163906970002.143852.17678518584089878259.stgit@warthog.procyon.org.uk/ # v2
Link: https://lore.kernel.org/r/163967174665.1823006.1301789965454084220.stgit@warthog.procyon.org.uk/ # v3
Link: https://lore.kernel.org/r/164021568841.640689.6684240152253400380.stgit@warthog.procyon.org.uk/ # v4
2022-01-07 13:44:47 +00:00
..
addr_list.c afs: Use kfree_rcu() instead of casting kfree() to rcu_callback_t 2020-03-13 10:47:33 -07:00
afs.h afs: Implement client support for the YFSVL.GetCellName RPC op 2020-06-04 15:37:57 +01:00
afs_cm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
afs_fs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
afs_vl.h afs: Implement client support for the YFSVL.GetCellName RPC op 2020-06-04 15:37:57 +01:00
callback.c afs: Try to avoid taking RCU read lock when checking vnode validity 2021-09-13 09:10:39 +01:00
cell.c afs: Convert afs to use the new fscache API 2022-01-07 13:44:47 +00:00
cmservice.c afs: Fix tracepoint string placement with built-in AFS 2021-07-21 15:08:35 +01:00
dir.c afs: Use folios in directory handling 2021-11-10 21:17:09 +00:00
dir_edit.c afs: Use folios in directory handling 2021-11-10 21:17:09 +00:00
dir_silly.c afs: Fix kerneldoc warning shown up by W=1 2021-10-04 22:04:44 +01:00
dynroot.c afs: Add tracing for cell refcount and active user count 2020-10-16 14:39:21 +01:00
file.c afs: Convert afs to use the new fscache API 2022-01-07 13:44:47 +00:00
flock.c fs: remove mandatory file locking support 2021-08-23 06:15:36 -04:00
fs_operation.c afs: Fix speculative status fetches 2021-05-01 11:55:36 -07:00
fs_probe.c afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server 2021-09-13 09:14:21 +01:00
fsclient.c afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server 2021-09-13 09:14:21 +01:00
inode.c afs: Convert afs to use the new fscache API 2022-01-07 13:44:47 +00:00
internal.h afs: Convert afs to use the new fscache API 2022-01-07 13:44:47 +00:00
Kconfig afs: Convert afs to use the new fscache API 2022-01-07 13:44:47 +00:00
main.c afs: Convert afs to use the new fscache API 2022-01-07 13:44:47 +00:00
Makefile afs: Convert afs to use the new fscache API 2022-01-07 13:44:47 +00:00
misc.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
mntpt.c afs: Stop listxattr() from listing "afs.*" attributes 2021-03-15 17:09:54 +00:00
proc.c afs: Add tracing for cell refcount and active user count 2020-10-16 14:39:21 +01:00
protocol_afs.h afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server 2021-09-13 09:14:21 +01:00
protocol_uae.h afs: Add support for the UAE error table 2019-06-28 18:37:53 +01:00
protocol_yfs.h afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server 2021-09-13 09:14:21 +01:00
rotate.c afs: Try to avoid taking RCU read lock when checking vnode validity 2021-09-13 09:10:39 +01:00
rxrpc.c afs: Use ITER_XARRAY for writing 2021-04-23 10:17:27 +01:00
security.c fs: make helpers idmap mount aware 2021-01-24 14:27:20 +01:00
server.c afs: Fix mmap coherency vs 3rd-party changes 2021-09-13 09:10:39 +01:00
server_list.c afs: Reorganise volume and server trees to be rooted on the cell 2020-06-04 15:37:57 +01:00
super.c afs: Fix mmap coherency vs 3rd-party changes 2021-09-13 09:10:39 +01:00
vl_alias.c afs: Add tracing for cell refcount and active user count 2020-10-16 14:39:21 +01:00
vl_list.c afs: Don't use VL probe running state to make decisions outside probe code 2020-08-20 18:21:28 +01:00
vl_probe.c afs: Don't use VL probe running state to make decisions outside probe code 2020-08-20 18:21:28 +01:00
vl_rotate.c afs: Add tracing for cell refcount and active user count 2020-10-16 14:39:21 +01:00
vlclient.c afs: Fix fall-through warnings for Clang 2021-05-25 07:30:34 -10:00
volume.c afs: Convert afs to use the new fscache API 2022-01-07 13:44:47 +00:00
write.c afs: Convert afs to use the new fscache API 2022-01-07 13:44:47 +00:00
xattr.c afs: Stop listxattr() from listing "afs.*" attributes 2021-03-15 17:09:54 +00:00
xdr_fs.h afs: Fix directory entry size calculation 2021-01-04 12:25:19 +00:00
yfsclient.c afs: Set mtime from the client for yfs create operations 2021-11-02 09:42:26 +00:00