• NeilBrown's avatar
    nfsd: add nfsd_file_acquire_local() · c63f0e48
    NeilBrown authored
    nfsd_file_acquire_local() can be used to look up a file by filehandle
    without having a struct svc_rqst.  This can be used by NFS LOCALIO to
    allow the NFS client to bypass the NFS protocol to directly access a
    file provided by the NFS server which is running in the same kernel.
    
    In nfsd_file_do_acquire() care is taken to always use fh_verify() if
    rqstp is not NULL (as is the case for non-LOCALIO callers).  Otherwise
    the non-LOCALIO callers will not supply the correct and required
    arguments to __fh_verify (e.g. gssclient isn't passed).
    
    Introduce fh_verify_local() wrapper around __fh_verify to make it
    clear that LOCALIO is intended caller.
    
    Also, use GC for nfsd_file returned by nfsd_file_acquire_local.  GC
    offers performance improvements if/when a file is reopened before
    launderette cleans it from the filecache's LRU.
    
    Suggested-by: Jeff Layton <jlayton@kernel.org> # use filecache's GC
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    Co-developed-by: default avatarMike Snitzer <snitzer@kernel.org>
    Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
    Signed-off-by: default avatarAnna Schumaker <anna.schumaker@oracle.com>
    c63f0e48
filecache.h 2.83 KB