diff options
author | ps <ps@FreeBSD.org> | 2004-12-06 21:11:15 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2004-12-06 21:11:15 +0000 |
commit | eeccf3813d92c16c33f1985fb7edf26c7c20c808 (patch) | |
tree | 83e874ad8aa3b9b3120558628b84b3010046974d /sys/nfsclient/nfs_vfsops.c | |
parent | 2b5157cd0d38228760370d2fcb197f915ce3b93d (diff) | |
download | FreeBSD-src-eeccf3813d92c16c33f1985fb7edf26c7c20c808.zip FreeBSD-src-eeccf3813d92c16c33f1985fb7edf26c7c20c808.tar.gz |
Rewrite of the NFS client's reply handling. We now have NFS socket
upcalls which do RPC header parsing and match up the reply with the
request. NFS calls now sleep on the nfsreq structure. This enables
us to eliminate the NFS recvlock.
Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
Diffstat (limited to 'sys/nfsclient/nfs_vfsops.c')
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 801335b..ff15eb1 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -817,6 +817,10 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, nfs_decode_args(nmp, argp); + if (nmp->nm_sotype == SOCK_STREAM) + mtx_init(&nmp->nm_nfstcpstate.mtx, "NFS/TCP state lock", + NULL, MTX_DEF); + /* * For Connection based sockets (TCP,...) defer the connect until * the first request, in case the server is not responding. @@ -862,6 +866,8 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, return (0); bad: + if (nmp->nm_sotype == SOCK_STREAM) + mtx_destroy(&nmp->nm_nfstcpstate.mtx); nfs_disconnect(nmp); uma_zfree(nfsmount_zone, nmp); FREE(nam, M_SONAME); @@ -903,6 +909,9 @@ nfs_unmount(struct mount *mp, int mntflags, struct thread *td) nfs_disconnect(nmp); FREE(nmp->nm_nam, M_SONAME); + if (nmp->nm_sotype == SOCK_STREAM) + mtx_destroy(&nmp->nm_nfstcpstate.mtx); + uma_zfree(nfsmount_zone, nmp); return (0); } |