• Weston Andros Adamson's avatar
    nfs: add LOCALIO support · 70ba381e
    Weston Andros Adamson authored
    Add client support for bypassing NFS for localhost reads, writes, and
    commits. This is only useful when the client and the server are
    running on the same host.
    
    nfs_local_probe() is stubbed out, later commits will enable client and
    server handshake via a Linux-only LOCALIO auxiliary RPC protocol.
    
    This has dynamic binding with the nfsd module (via nfs_localio module
    which is part of nfs_common). LOCALIO will only work if nfsd is
    already loaded.
    
    The "localio_enabled" nfs kernel module parameter can be used to
    disable and enable the ability to use LOCALIO support.
    
    CONFIG_NFS_LOCALIO enables NFS client support for LOCALIO.
    
    Lastly, LOCALIO uses an nfsd_file to initiate all IO. To make proper
    use of nfsd_file (and nfsd's filecache) its lifetime (duration before
    nfsd_file_put is called) must extend until after commit, read and
    write operations. So rather than immediately drop the nfsd_file
    reference in nfs_local_open_fh(), that doesn't happen until
    nfs_local_pgio_release() for read/write and not until
    nfs_local_release_commit_data() for commit. The same applies to the
    reference held on nfsd's nn->nfsd_serv. Both objects' lifetimes and
    associated references are managed through calls to
    nfs_to->nfsd_file_put_local().
    Signed-off-by: default avatarWeston Andros Adamson <dros@primarydata.com>
    Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
    Co-developed-by: default avatarMike Snitzer <snitzer@kernel.org>
    Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
    Signed-off-by: NeilBrown <neilb@suse.de> # nfs_open_local_fh
    Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
    Signed-off-by: default avatarAnna Schumaker <anna.schumaker@oracle.com>
    70ba381e
write.c 57.8 KB