linux/fs/afs
David Howells f3ddee8dc4 afs: Fix directory handling
AFS directories are structured blobs that are downloaded just like files
and then parsed by the lookup and readdir code and, as such, are currently
handled in the pagecache like any other file, with the entire directory
content being thrown away each time the directory changes.

However, since the blob is a known structure and since the data version
counter on a directory increases by exactly one for each change committed
to that directory, we can actually edit the directory locally rather than
fetching it from the server after each locally-induced change.

What we can't do, though, is mix data from the server and data from the
client since the server is technically at liberty to rearrange or compress
a directory if it sees fit, provided it updates the data version number
when it does so and breaks the callback (ie. sends a notification).

Further, lookup with lookup-ahead, readdir and, when it arrives, local
editing are likely want to scan the whole of a directory.

So directory handling needs to be improved to maintain the coherency of the
directory blob prior to permitting local directory editing.

To this end:

 (1) If any directory page gets discarded, invalidate and reread the entire
     directory.

 (2) If readpage notes that if when it fetches a single page that the
     version number has changed, the entire directory is flagged for
     invalidation.

 (3) Read as much of the directory in one go as we can.

Note that this removes local caching of directories in fscache for the
moment as we can't pass the pages to fscache_read_or_alloc_pages() since
page->lru is in use by the LRU.

Signed-off-by: David Howells <dhowells@redhat.com>
2018-04-09 21:54:48 +01:00
..
addr_list.c afs: Fix checker warnings 2018-04-09 21:12:31 +01:00
afs_cm.h afs: support the CB.ProbeUuid RPC op 2008-04-29 08:06:26 -07:00
afs_fs.h afs: Prospectively look up extra files when doing a single lookup 2018-04-09 21:12:31 +01:00
afs_vl.h afs: Make use of the YFS service upgrade to fully support IPv6 2017-11-13 15:38:19 +00:00
afs.h afs: Rearrange status mapping 2018-04-09 21:53:59 +01:00
cache.c fscache: Pass object size in rather than calling back for it 2018-04-06 14:05:14 +01:00
callback.c afs: Prospectively look up extra files when doing a single lookup 2018-04-09 21:12:31 +01:00
cell.c afs: Implement @cell substitution handling 2018-04-09 21:18:58 +01:00
cmservice.c afs: Prospectively look up extra files when doing a single lookup 2018-04-09 21:12:31 +01:00
dir.c afs: Fix directory handling 2018-04-09 21:54:48 +01:00
dynroot.c afs: Split the dynroot stuff out and give it its own ops tables 2018-04-09 21:54:00 +01:00
file.c afs: Fix directory handling 2018-04-09 21:54:48 +01:00
flock.c afs: Make it possible to get the data version in readpage 2018-04-09 21:53:56 +01:00
fsclient.c afs: Fix directory handling 2018-04-09 21:54:48 +01:00
inode.c afs: Fix directory handling 2018-04-09 21:54:48 +01:00
internal.h afs: Fix directory handling 2018-04-09 21:54:48 +01:00
Kconfig fs/afs: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:39:04 -08:00
main.c afs: Implement @sys substitution handling 2018-04-09 21:12:31 +01:00
Makefile afs: Split the dynroot stuff out and give it its own ops tables 2018-04-09 21:54:00 +01:00
misc.c afs: Consolidate abort_to_error translators 2017-11-13 15:38:17 +00:00
mntpt.c afs: Support the AFS dynamic root 2018-02-06 14:43:37 +00: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: Fix directory handling 2018-04-09 21:54:48 +01:00
rotate.c afs: Fix checker warnings 2018-04-09 21:12:31 +01:00
rxrpc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-04-03 14:04:18 -07:00
security.c afs: Make it possible to get the data version in readpage 2018-04-09 21:53:56 +01:00
server_list.c afs: Fix server list handling 2018-02-06 14:36:54 +00:00
server.c afs: Fix checker warnings 2018-04-09 21:12:31 +01:00
super.c afs: Split the dynroot stuff out and give it its own ops tables 2018-04-09 21:54:00 +01:00
vlclient.c afs: Fix checker warnings 2018-04-09 21:12:31 +01:00
volume.c fscache: Pass object size in rather than calling back for it 2018-04-06 14:05:14 +01:00
write.c afs: Fix directory handling 2018-04-09 21:54:48 +01:00
xattr.c afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
xdr_fs.h afs: Rearrange status mapping 2018-04-09 21:53:59 +01:00