linux/fs/nfsd
Jeff Layton 65294c1f2c nfsd: add a new struct file caching facility to nfsd
Currently, NFSv2/3 reads and writes have to open a file, do the read or
write and then close it again for each RPC. This is highly inefficient,
especially when the underlying filesystem has a relatively slow open
routine.

This patch adds a new open file cache to knfsd. Rather than doing an
open for each RPC, the read/write handlers can call into this cache to
see if there is one already there for the correct filehandle and
NFS_MAY_READ/WRITE flags.

If there isn't an entry, then we create a new one and attempt to
perform the open. If there is, then we wait until the entry is fully
instantiated and return it if it is at the end of the wait. If it's
not, then we attempt to take over construction.

Since the main goal is to speed up NFSv2/3 I/O, we don't want to
close these files on last put of these objects. We need to keep them
around for a little while since we never know when the next READ/WRITE
will come in.

Cache entries have a hardcoded 1s timeout, and we have a recurring
workqueue job that walks the cache and purges any entries that have
expired.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Signed-off-by: Richard Sharpe <richard.sharpe@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2019-08-19 11:00:39 -04:00
..
acl.h
auth.c nfsd: auth: Fix gid sorting when rootsquash enabled 2018-01-22 20:13:07 -08:00
auth.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
blocklayout.c nfsd: use 64-bit seconds fields in nfsd v4 code 2019-07-03 17:52:09 -04:00
blocklayoutxdr.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
blocklayoutxdr.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cache.h nfsd4: drc containerization 2019-07-03 17:52:08 -04:00
current_stateid.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
export.c nfsd: add a new struct file caching facility to nfsd 2019-08-19 11:00:39 -04:00
export.h knfsd: Allow lockless lookups of the exports 2018-10-29 16:58:04 -04:00
fault_inject.c nfsd: no need to check return value of debugfs_create functions 2019-07-03 16:57:17 +02:00
filecache.c nfsd: add a new struct file caching facility to nfsd 2019-08-19 11:00:39 -04:00
filecache.h nfsd: add a new struct file caching facility to nfsd 2019-08-19 11:00:39 -04:00
flexfilelayout.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
flexfilelayoutxdr.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
flexfilelayoutxdr.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
idmap.h nfsd: Remove duplicate define of IDMAP_NAMESZ/IDMAP_TYPE_xx 2015-07-20 14:58:46 -04:00
Kconfig nfsd: add a new struct file caching facility to nfsd 2019-08-19 11:00:39 -04:00
lockd.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile nfsd: add a new struct file caching facility to nfsd 2019-08-19 11:00:39 -04:00
netns.h nfsd: make client/ directory names small ints 2019-07-03 17:52:50 -04:00
nfs2acl.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfs3acl.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfs3proc.c nfsd/nfsd3_proc_readdir: fix buffer count and page pointers 2019-04-05 19:57:24 -04:00
nfs3xdr.c nfsd: knfsd must use the container user namespace 2019-04-24 09:46:35 -04:00
nfs4acl.c nfsd: check permissions when setting ACLs 2016-06-24 12:11:52 -04:00
nfs4callback.c nfsd: Remove unnecessary NULL checks 2019-08-16 13:49:29 -04:00
nfs4idmap.c nfsd: Fix misuse of strlcpy 2019-07-08 23:16:11 -04:00
nfs4layouts.c nfsd: update callback done processing 2019-05-03 11:01:38 -04:00
nfs4proc.c This pull consists mostly of nfsd container work: 2019-05-15 18:21:43 -07:00
nfs4recover.c This pull consists mostly of nfsd container work: 2019-05-15 18:21:43 -07:00
nfs4state.c nfsd: Make two functions static 2019-07-09 19:36:33 -04:00
nfs4xdr.c nfsd: decode implementation id 2019-07-03 20:54:03 -04:00
nfscache.c nfsd4: Fix kernel crash when reading proc file reply_cache_stats 2019-08-16 13:36:55 -04:00
nfsctl.c nfsd: initialize i_private before d_add 2019-08-15 16:24:07 -04:00
nfsd.h nfsd4: add a client info file 2019-07-03 17:52:50 -04:00
nfsfh.c nfsd: use true and false for boolean values 2018-08-09 16:11:21 -04:00
nfsfh.h This request is late, apologies. 2018-02-08 15:18:32 -08:00
nfsproc.c NFSD: Handle full-length symlinks 2018-08-09 16:11:21 -04:00
nfssvc.c nfsd: add a new struct file caching facility to nfsd 2019-08-19 11:00:39 -04:00
nfsxdr.c nfsd: knfsd must use the container user namespace 2019-04-24 09:46:35 -04:00
pnfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
state.h Driver Core and debugfs changes for 5.3-rc1 2019-07-12 12:24:03 -07:00
stats.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stats.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace.c nfsd: move include of state.h from trace.c to trace.h 2015-10-23 15:57:29 -04:00
trace.h nfsd: add a new struct file caching facility to nfsd 2019-08-19 11:00:39 -04:00
vfs.c nfsd: add a new struct file caching facility to nfsd 2019-08-19 11:00:39 -04:00
vfs.h nfsd: add a new struct file caching facility to nfsd 2019-08-19 11:00:39 -04:00
xdr.h NFSD: Clean up legacy NFS SYMLINK argument XDR decoders 2018-04-03 15:08:16 -04:00
xdr3.h NFSD: Clean up legacy NFS SYMLINK argument XDR decoders 2018-04-03 15:08:16 -04:00
xdr4.h nfsd: decode implementation id 2019-07-03 20:54:03 -04:00
xdr4cb.h NFSD CB_OFFLOAD xdr 2018-09-25 20:34:54 -04:00