• Weston Andros Adamson's avatar
    nfsd: add LOCALIO support · fa498386
    Weston Andros Adamson authored
    Add server support for bypassing NFS for localhost reads, writes, and
    commits. This is only useful when both the client and server are
    running on the same host.
    
    If nfsd_open_local_fh() fails then the NFS client will both retry and
    fallback to normal network-based read, write and commit operations if
    localio is no longer supported.
    
    Care is taken to ensure the same NFS security mechanisms are used
    (authentication, etc) regardless of whether localio or regular NFS
    access is used.  The auth_domain established as part of the traditional
    NFS client access to the NFS server is also used for localio.  Store
    auth_domain for localio in nfsd_uuid_t and transfer it to the client
    if it is local to the server.
    
    Relative to containers, localio gives the client access to the network
    namespace the server has.  This is required to allow the client to
    access the server's per-namespace nfsd_net struct.
    
    This commit also introduces the use of NFSD's percpu_ref to interlock
    nfsd_destroy_serv and nfsd_open_local_fh, to ensure nn->nfsd_serv is
    not destroyed while in use by nfsd_open_local_fh and other LOCALIO
    client code.
    
    CONFIG_NFS_LOCALIO enables NFS server support for LOCALIO.
    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>
    Co-developed-by: default avatarNeilBrown <neilb@suse.de>
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
    Acked-by: default avatarChuck Lever <chuck.lever@oracle.com>
    Signed-off-by: default avatarAnna Schumaker <anna.schumaker@oracle.com>
    fa498386
Makefile 942 Bytes