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/fs/portalfs | |
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/fs/portalfs')
-rw-r--r-- | sys/fs/portalfs/portal_vnops.c | 33 |
1 files changed, 12 insertions, 21 deletions
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 <sys/param.h> +#include <sys/systm.h> +#include <sys/sysproto.h> +#include <sys/kernel.h> +#include <sys/time.h> +#include <sys/proc.h> +#include <sys/filedesc.h> +#include <sys/vnode.h> #include <sys/fcntl.h> #include <sys/file.h> -#include <sys/filedesc.h> -#include <sys/kernel.h> -#include <sys/lock.h> -#include <sys/malloc.h> -#include <sys/mbuf.h> +#include <sys/stat.h> #include <sys/mount.h> -#include <sys/mutex.h> +#include <sys/malloc.h> #include <sys/namei.h> -#include <sys/proc.h> +#include <sys/mbuf.h> #include <sys/socket.h> #include <sys/socketvar.h> -#include <sys/stat.h> -#include <sys/systm.h> -#include <sys/sysproto.h> -#include <sys/time.h> #include <sys/un.h> #include <sys/unpcb.h> -#include <sys/vnode.h> #include <fs/portalfs/portal.h> 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) { |