NFSv4.2: add client side xattr caching.

Implement client side caching for NFSv4.2 extended attributes. The cache
is a per-inode hashtable, with name/value entries. There is one special
entry for the listxattr cache.

NFS inodes have a pointer to a cache structure. The cache structure is
allocated on demand, freed when the cache is invalidated.

Memory shrinkers keep the size in check. Large entries (> PAGE_SIZE)
are collected by a separate shrinker, and freed more aggressively
than others.

Signed-off-by: Frank van der Linden <fllinden@amazon.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
Frank van der Linden 2020-06-23 22:39:04 +00:00 committed by Trond Myklebust
parent 012a211abd
commit 95ad37f90c
9 changed files with 1179 additions and 8 deletions

View file

@ -102,6 +102,8 @@ struct nfs_delegation;
struct posix_acl;
struct nfs4_xattr_cache;
/*
* nfs fs inode data in memory
*/
@ -188,6 +190,10 @@ struct nfs_inode {
struct fscache_cookie *fscache;
#endif
struct inode vfs_inode;
#ifdef CONFIG_NFS_V4_2
struct nfs4_xattr_cache *xattr_cache;
#endif
};
struct nfs4_copy_state {