afs: Locally edit directory data for mkdir/create/unlink/...
authorDavid Howells <dhowells@redhat.com>
Fri, 6 Apr 2018 13:17:25 +0000 (14:17 +0100)
committerDavid Howells <dhowells@redhat.com>
Mon, 9 Apr 2018 20:54:48 +0000 (21:54 +0100)
commit63a4681ff39cb63314b8ff41319e70fb0e606ed2
tree0b60198db6c9a21efd1f1dfda2a292ad63df38e8
parent0031763698d197d779fcafe5685f6e7818b70d32
afs: Locally edit directory data for mkdir/create/unlink/...

Locally edit the contents of an AFS directory upon a successful inode
operation that modifies that directory (such as mkdir, create and unlink)
so that we can avoid the current practice of re-downloading the directory
after each change.

This is viable provided that the directory version number we get back from
the modifying RPC op is exactly incremented by 1 from what we had
previously.  The data in the directory contents is in a defined format that
we have to parse locally to perform lookups and readdir, so modifying isn't
a problem.

If the edit fails, we just clear the VALID flag on the directory and it
will be reloaded next time it is needed.

Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/Makefile
fs/afs/dir.c
fs/afs/dir_edit.c [new file with mode: 0644]
fs/afs/fsclient.c
fs/afs/inode.c
fs/afs/internal.h
fs/afs/proc.c
include/trace/events/afs.h