Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern In soreceive(), don't call sopendfree() if MSG_DONT...



details:   https://anonhg.NetBSD.org/src/rev/1c8f57088298
branches:  trunk
changeset: 526629:1c8f57088298
user:      enami <enami%NetBSD.org@localhost>
date:      Tue May 07 08:06:35 2002 +0000

description:
In soreceive(), don't call sopendfree() if MSG_DONTWAIT is set
since it may sleep.  nfsrv_rcv() tries to do its jobs in softintr
handler as far as possible.

diffstat:

 sys/kern/uipc_socket.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r c132e115b70f -r 1c8f57088298 sys/kern/uipc_socket.c
--- a/sys/kern/uipc_socket.c    Tue May 07 06:45:22 2002 +0000
+++ b/sys/kern/uipc_socket.c    Tue May 07 08:06:35 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_socket.c,v 1.65 2002/05/03 00:35:14 thorpej Exp $ */
+/*     $NetBSD: uipc_socket.c,v 1.66 2002/05/07 08:06:35 enami Exp $   */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.65 2002/05/03 00:35:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.66 2002/05/07 08:06:35 enami Exp $");
 
 #include "opt_sock_counters.h"
 #include "opt_sosend_loan.h"
@@ -798,8 +798,6 @@
        struct protosw  *pr;
        struct mbuf     *nextrecord;
 
-       sodopendfree(so);
-
        pr = so->so_proto;
        mp = mp0;
        type = 0;
@@ -812,6 +810,10 @@
                flags = *flagsp &~ MSG_EOR;
        else
                flags = 0;
+
+       if ((flags & MSG_DONTWAIT) == 0)
+               sodopendfree(so);
+
        if (flags & MSG_OOB) {
                m = m_get(M_WAIT, MT_DATA);
                error = (*pr->pr_usrreq)(so, PRU_RCVOOB, m,



Home | Main Index | Thread Index | Old Index