diff options
author | Seigo Tanimura <tanimura@FreeBSD.org> | 2002-05-31 11:52:35 +0000 |
---|---|---|
committer | Seigo Tanimura <tanimura@FreeBSD.org> | 2002-05-31 11:52:35 +0000 |
commit | 4cc20ab1f0f3d1126126327aa298ab88c974c53d (patch) | |
tree | 9d5f24794525313566896ab89aa860515db344a6 /sys/nfsclient | |
parent | c82593cf2c9a5b4ccd2be043f6c9ccc8af22fcc9 (diff) | |
download | src-4cc20ab1f0f3d1126126327aa298ab88c974c53d.tar.gz src-4cc20ab1f0f3d1126126327aa298ab88c974c53d.zip |
Back out my lats commit of locking down a socket, it conflicts with hsu's work.
Requested by: hsu
Notes
Notes:
svn path=/head/; revision=97658
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/bootp_subr.c | 7 | ||||
-rw-r--r-- | sys/nfsclient/nfs_socket.c | 21 |
2 files changed, 6 insertions, 22 deletions
diff --git a/sys/nfsclient/bootp_subr.c b/sys/nfsclient/bootp_subr.c index 6dbfc4c67f89..993e0c542a95 100644 --- a/sys/nfsclient/bootp_subr.c +++ b/sys/nfsclient/bootp_subr.c @@ -752,13 +752,8 @@ bootpc_call(struct bootpc_globalcontext *gctx, struct thread *td) error = sosend(so, (struct sockaddr *) &dst, &auio, NULL, NULL, 0, td); if (error != 0) { - int sostate; - - SOCK_LOCK(so); - sostate = (int)so->so_state; - SOCK_UNLOCK(so); printf("bootpc_call: sosend: %d state %08x\n", - error, sostate); + error, (int) so->so_state); } /* XXX: Is this needed ? */ diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index 09ea0e018e9d..be0063c26e45 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -230,21 +230,18 @@ nfs_connect(struct nfsmount *nmp, struct nfsreq *rep) * that interruptible mounts don't hang here for a long time. */ s = splnet(); - SOCK_LOCK(so); while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) { - (void) msleep((caddr_t)&so->so_timeo, SOCK_MTX(so), + (void) tsleep((caddr_t)&so->so_timeo, PSOCK, "nfscon", 2 * hz); if ((so->so_state & SS_ISCONNECTING) && so->so_error == 0 && rep && (error = nfs_sigintr(nmp, rep, (rep->r_td ? rep->r_td->td_proc : NULL))) != 0){ so->so_state &= ~SS_ISCONNECTING; - SOCK_UNLOCK(so); splx(s); goto bad; } } - SOCK_UNLOCK(so); if (so->so_error) { error = so->so_error; so->so_error = 0; @@ -417,14 +414,10 @@ nfs_send(struct socket *so, struct sockaddr *nam, struct mbuf *top, rep->r_flags &= ~R_MUSTRESEND; soflags = rep->r_nmp->nm_soflags; - SOCK_LOCK(so); - if ((soflags & PR_CONNREQUIRED) || (so->so_state & SS_ISCONNECTED)) { - SOCK_UNLOCK(so); + if ((soflags & PR_CONNREQUIRED) || (so->so_state & SS_ISCONNECTED)) sendnam = (struct sockaddr *)0; - } else { - SOCK_UNLOCK(so); + else sendnam = nam; - } if (so->so_type == SOCK_SEQPACKET) flags = MSG_EOR; else @@ -653,14 +646,10 @@ errout: } else { if ((so = rep->r_nmp->nm_so) == NULL) return (EACCES); - SOCK_LOCK(so); - if (so->so_state & SS_ISCONNECTED) { - SOCK_UNLOCK(so); + if (so->so_state & SS_ISCONNECTED) getnam = (struct sockaddr **)0; - } else { - SOCK_UNLOCK(so); + else getnam = aname; - } auio.uio_resid = len = 1000000; auio.uio_td = td; do { |