]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
nfsd: add a new struct file caching facility to nfsd
authorJeff Layton <jlayton@poochiereds.net>
Tue, 20 Oct 2015 17:33:42 +0000 (13:33 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 23 Oct 2015 19:57:38 +0000 (15:57 -0400)
commit1c29dd2f56b16da19b18979012447813e781ccb5
tree568bb99720841f49e845a6475bd4699d2c2a9795
parentae9fdb9016dea1dc356dbed81344c4617070b09a
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.

Note that this patch just adds the infrastructure to allow the caching
of open files. Later patches will actually make nfsd use it.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/Kconfig
fs/nfsd/Makefile
fs/nfsd/export.c
fs/nfsd/filecache.c [new file with mode: 0644]
fs/nfsd/filecache.h [new file with mode: 0644]
fs/nfsd/nfssvc.c
fs/nfsd/trace.h
fs/nfsd/vfs.c
fs/nfsd/vfs.h