From e6fa9b9e922913444c2e6b2b58bf3de5eaed868d Mon Sep 17 00:00:00 2001 From: tanimura Date: Fri, 31 May 2002 11:52:35 +0000 Subject: Back out my lats commit of locking down a socket, it conflicts with hsu's work. Requested by: hsu --- sys/fs/portalfs/portal_vnops.c | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'sys/fs/portalfs') diff --git a/sys/fs/portalfs/portal_vnops.c b/sys/fs/portalfs/portal_vnops.c index 23b471f..b345c57 100644 --- a/sys/fs/portalfs/portal_vnops.c +++ b/sys/fs/portalfs/portal_vnops.c @@ -43,26 +43,24 @@ */ #include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include +#include #include -#include +#include #include -#include +#include #include #include -#include -#include -#include -#include #include #include -#include #include static int portal_fileid = PORTAL_ROOTFILEID+1; @@ -184,12 +182,8 @@ portal_connect(so, so2) if (so->so_type != so2->so_type) return (EPROTOTYPE); - SOCK_LOCK(so2); - if ((so2->so_options & SO_ACCEPTCONN) == 0) { - SOCK_UNLOCK(so2); + if ((so2->so_options & SO_ACCEPTCONN) == 0) return (ECONNREFUSED); - } - SOCK_UNLOCK(so2); if ((so3 = sonewconn(so2, 0)) == 0) return (ECONNREFUSED); @@ -286,17 +280,14 @@ portal_open(ap) * and keep polling the reference count. XXX. */ s = splnet(); - SOCK_LOCK(so); while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) { if (fmp->pm_server->f_count == 1) { - SOCK_UNLOCK(so); error = ECONNREFUSED; splx(s); goto bad; } - (void) msleep((caddr_t) &so->so_timeo, SOCK_MTX(so), PSOCK, "portalcon", 5 * hz); + (void) tsleep((caddr_t) &so->so_timeo, PSOCK, "portalcon", 5 * hz); } - SOCK_UNLOCK(so); splx(s); if (so->so_error) { -- cgit v1.1