diff options
author | jeff <jeff@FreeBSD.org> | 2002-03-20 21:23:26 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2002-03-20 21:23:26 +0000 |
commit | f3500695899f1d9bea97953b3c47061bbe7ac1e7 (patch) | |
tree | 60675244255a11eb7f518d2be37b0f2482d5c33d | |
parent | d180de2878e9ea5b8128d4a282ca5bd9202a0e29 (diff) | |
download | FreeBSD-src-f3500695899f1d9bea97953b3c47061bbe7ac1e7.zip FreeBSD-src-f3500695899f1d9bea97953b3c47061bbe7ac1e7.tar.gz |
UMA permited us to utilize the 'waitok' flag to soalloc.
-rw-r--r-- | sys/kern/uipc_socket.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index f578dcd..3c1adf8 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -106,7 +106,6 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, numopensockets, CTLFLAG_RD, /* * Get a socket structure from our zone, and initialize it. - * We don't implement `waitok' yet (see comments in uipc_domain.c). * Note that it would probably be better to allocate socket * and PCB at the same time, but I'm not convinced that all * the protocols can be easily modified to do this. @@ -118,8 +117,14 @@ soalloc(waitok) int waitok; { struct socket *so; + int flag; - so = uma_zalloc(socket_zone, waitok); + if (waitok == 1) + flag = M_WAITOK; + else + flag = M_NOWAIT; + + so = uma_zalloc(socket_zone, flag); if (so) { /* XXX race condition for reentrant kernel */ bzero(so, sizeof *so); |