diff options
author | tanimura <tanimura@FreeBSD.org> | 2002-05-31 11:52:35 +0000 |
---|---|---|
committer | tanimura <tanimura@FreeBSD.org> | 2002-05-31 11:52:35 +0000 |
commit | e6fa9b9e922913444c2e6b2b58bf3de5eaed868d (patch) | |
tree | 9d5f24794525313566896ab89aa860515db344a6 /sys/netsmb | |
parent | 1ea6cbb8c29088e04528460633798a6c131ca1ba (diff) | |
download | FreeBSD-src-e6fa9b9e922913444c2e6b2b58bf3de5eaed868d.zip FreeBSD-src-e6fa9b9e922913444c2e6b2b58bf3de5eaed868d.tar.gz |
Back out my lats commit of locking down a socket, it conflicts with hsu's work.
Requested by: hsu
Diffstat (limited to 'sys/netsmb')
-rw-r--r-- | sys/netsmb/smb_trantcp.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/sys/netsmb/smb_trantcp.c b/sys/netsmb/smb_trantcp.c index 53c918b..bb017bf 100644 --- a/sys/netsmb/smb_trantcp.c +++ b/sys/netsmb/smb_trantcp.c @@ -250,18 +250,15 @@ nb_connect_in(struct nbpcb *nbp, struct sockaddr_in *to, struct thread *td) if (error) goto bad; s = splnet(); - SOCK_LOCK(so); while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) { - msleep(&so->so_timeo, SOCK_MTX(so), PSOCK, "nbcon", 2 * hz); + tsleep(&so->so_timeo, PSOCK, "nbcon", 2 * hz); if ((so->so_state & SS_ISCONNECTING) && so->so_error == 0 && (error = nb_intr(nbp, td->td_proc)) != 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; @@ -411,15 +408,12 @@ nbssn_recv(struct nbpcb *nbp, struct mbuf **mpp, int *lenp, for(;;) { m = NULL; error = nbssn_recvhdr(nbp, &len, &rpcode, MSG_DONTWAIT, td); - SOCK_LOCK(so); if (so->so_state & (SS_ISDISCONNECTING | SS_ISDISCONNECTED | SS_CANTRCVMORE)) { - SOCK_UNLOCK(so); nbp->nbp_state = NBST_CLOSED; NBDEBUG("session closed by peer\n"); return ECONNRESET; } - SOCK_UNLOCK(so); if (error) return error; if (len == 0 && nbp->nbp_state != NBST_SESSION) @@ -645,10 +639,8 @@ smb_nbst_intr(struct smb_vc *vcp) if (nbp == NULL || nbp->nbp_tso == NULL) return; - SOCK_LOCK(nbp->nbp_tso); sorwakeup(nbp->nbp_tso); sowwakeup(nbp->nbp_tso); - SOCK_UNLOCK(nbp->nbp_tso); } static int |