mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-24 21:24:00 +08:00
65294c1f2c
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>
26 lines
938 B
Makefile
26 lines
938 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Makefile for the Linux nfs server
|
|
#
|
|
|
|
ccflags-y += -I$(src) # needed for trace events
|
|
|
|
obj-$(CONFIG_NFSD) += nfsd.o
|
|
|
|
# this one should be compiled first, as the tracing macros can easily blow up
|
|
nfsd-y += trace.o
|
|
|
|
nfsd-y += nfssvc.o nfsctl.o nfsproc.o nfsfh.o vfs.o \
|
|
export.o auth.o lockd.o nfscache.o nfsxdr.o \
|
|
stats.o filecache.o
|
|
nfsd-$(CONFIG_NFSD_FAULT_INJECTION) += fault_inject.o
|
|
nfsd-$(CONFIG_NFSD_V2_ACL) += nfs2acl.o
|
|
nfsd-$(CONFIG_NFSD_V3) += nfs3proc.o nfs3xdr.o
|
|
nfsd-$(CONFIG_NFSD_V3_ACL) += nfs3acl.o
|
|
nfsd-$(CONFIG_NFSD_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4idmap.o \
|
|
nfs4acl.o nfs4callback.o nfs4recover.o
|
|
nfsd-$(CONFIG_NFSD_PNFS) += nfs4layouts.o
|
|
nfsd-$(CONFIG_NFSD_BLOCKLAYOUT) += blocklayout.o blocklayoutxdr.o
|
|
nfsd-$(CONFIG_NFSD_SCSILAYOUT) += blocklayout.o blocklayoutxdr.o
|
|
nfsd-$(CONFIG_NFSD_FLEXFILELAYOUT) += flexfilelayout.o flexfilelayoutxdr.o
|