linux/fs/afs
David Howells be080a6f43 afs: Overhaul permit caching
Overhaul permit caching in AFS by making it per-vnode and sharing permit
lists where possible.

When most of the fileserver operations are called, they return a status
structure indicating the (revised) details of the vnode or vnodes involved
in the operation.  This includes the access mark derived from the ACL
(named CallerAccess in the protocol definition file).  This is cacheable
and if the ACL changes, the server will tell us that it is breaking the
callback promise, at which point we can discard the currently cached
permits.

With this patch, the afs_permits structure has, at the end, an array of
{ key, CallerAccess } elements, sorted by key pointer.  This is then cached
in a hash table so that it can be shared between vnodes with the same
access permits.

Permit lists can only be shared if they contain the exact same set of
key->CallerAccess mappings.

Note that that table is global rather than being per-net_ns.  If the keys
in a permit list cross net_ns boundaries, there is no problem sharing the
cached permits, since the permits are just integer masks.

Since permit lists pin keys, the permit cache also makes it easier for a
future patch to find all occurrences of a key and remove them by means of
setting the afs_permits::invalidated flag and then clearing the appropriate
key pointer.  In such an event, memory barriers will need adding.

Lastly, the permit caching is skipped if the server has sent either a
vnode-specific or an entire-server callback since the start of the
operation.

Signed-off-by: David Howells <dhowells@redhat.com>
2017-11-13 15:38:18 +00:00
..
Kconfig fs/afs: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:39:04 -08:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
afs.h afs: Overhaul permit caching 2017-11-13 15:38:18 +00:00
afs_cm.h afs: support the CB.ProbeUuid RPC op 2008-04-29 08:06:26 -07:00
afs_fs.h afs: Overhaul the callback handling 2017-11-13 15:38:18 +00:00
afs_vl.h afs: Add some protocol defs 2017-11-13 15:38:17 +00:00
cache.c afs: Update the cache index structure 2017-11-13 15:38:17 +00:00
callback.c afs: Overhaul the callback handling 2017-11-13 15:38:18 +00:00
cell.c afs: Allow IPv6 address specification of VL servers 2017-11-13 15:38:17 +00:00
cmservice.c afs: Overhaul the callback handling 2017-11-13 15:38:18 +00:00
dir.c afs: Overhaul the callback handling 2017-11-13 15:38:18 +00:00
file.c afs: Condense afs_call's reply{,2,3,4} into an array 2017-11-13 15:38:17 +00:00
flock.c afs: Overhaul permit caching 2017-11-13 15:38:18 +00:00
fsclient.c afs: Overhaul permit caching 2017-11-13 15:38:18 +00:00
inode.c afs: Overhaul permit caching 2017-11-13 15:38:18 +00:00
internal.h afs: Overhaul permit caching 2017-11-13 15:38:18 +00:00
main.c afs: Overhaul permit caching 2017-11-13 15:38:18 +00:00
misc.c afs: Consolidate abort_to_error translators 2017-11-13 15:38:17 +00:00
mntpt.c afs: Add metadata xattrs 2017-07-09 14:40:12 -07:00
netdevices.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
proc.c afs: Allow IPv6 address specification of VL servers 2017-11-13 15:38:17 +00:00
rxrpc.c afs: Rename struct afs_call server member to cm_server 2017-11-13 15:38:18 +00:00
security.c afs: Overhaul permit caching 2017-11-13 15:38:18 +00:00
server.c afs: Overhaul the callback handling 2017-11-13 15:38:18 +00:00
super.c afs: Overhaul permit caching 2017-11-13 15:38:18 +00:00
vlclient.c afs: Condense afs_call's reply{,2,3,4} into an array 2017-11-13 15:38:17 +00:00
vlocation.c afs: Keep and pass sockaddr_rxrpc addresses rather than in_addr 2017-11-13 15:38:17 +00:00
vnode.c afs: Overhaul permit caching 2017-11-13 15:38:18 +00:00
volume.c afs: Overhaul the callback handling 2017-11-13 15:38:18 +00:00
write.c fs: convert a pile of fsync routines to errseq_t based reporting 2017-08-01 08:39:29 -04:00
xattr.c afs: Add metadata xattrs 2017-07-09 14:40:12 -07:00