Adapt to new sosend/soreceive and upcall (now down in sowakeup) trunk
authormatt <matt@NetBSD.org>
Sat, 25 Apr 1998 17:41:01 +0000
branchtrunk
changeset 38813 169179db536e
parent 38812 49bace286cc7
child 38814 53b56012a678
Adapt to new sosend/soreceive and upcall (now down in sowakeup)
sys/nfs/nfs_boot.c
sys/nfs/nfs_socket.c
sys/nfs/nfs_syscalls.c
--- a/sys/nfs/nfs_boot.c	Sat Apr 25 17:35:18 1998 +0000
+++ b/sys/nfs/nfs_boot.c	Sat Apr 25 17:41:01 1998 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_boot.c,v 1.44 1998/03/01 02:24:27 fvdl Exp $	*/
+/*	$NetBSD: nfs_boot.c,v 1.45 1998/04/25 17:41:01 matt Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1997 The NetBSD Foundation, Inc.
@@ -261,7 +261,7 @@
 		error = ENOBUFS;
 		goto out;
 	}
-	error = sosend(so, nam, NULL, m, NULL, 0);
+	error = (*so->so_send)(so, nam, NULL, m, NULL, 0);
 	if (error) {
 		printf("nfs_boot: sosend: %d\n", error);
 		goto out;
@@ -285,7 +285,7 @@
 		}
 		uio.uio_resid = 1 << 16; /* ??? */
 		rcvflg = 0;
-		error = soreceive(so, &from, &uio, &m, NULL, &rcvflg);
+		error = (*so->so_receive)(so, &from, &uio, &m, NULL, &rcvflg);
 		if (error == EWOULDBLOCK) {
 			if (--secs <= 0)
 				goto send_again;
--- a/sys/nfs/nfs_socket.c	Sat Apr 25 17:35:18 1998 +0000
+++ b/sys/nfs/nfs_socket.c	Sat Apr 25 17:41:01 1998 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_socket.c,v 1.42 1998/02/19 00:54:13 thorpej Exp $	*/
+/*	$NetBSD: nfs_socket.c,v 1.43 1998/04/25 17:41:01 matt Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1995
@@ -389,7 +389,7 @@
 	else
 		flags = 0;
 
-	error = sosend(so, sendnam, (struct uio *)0, top,
+	error = (*so->so_send)(so, sendnam, (struct uio *)0, top,
 		(struct mbuf *)0, flags);
 	if (error) {
 		if (rep) {
@@ -509,7 +509,7 @@
 			auio.uio_procp = p;
 			do {
 			   rcvflg = MSG_WAITALL;
-			   error = soreceive(so, (struct mbuf **)0, &auio,
+			   error = (*so->so_receive)(so, (struct mbuf **)0, &auio,
 				(struct mbuf **)0, (struct mbuf **)0, &rcvflg);
 			   if (error == EWOULDBLOCK && rep) {
 				if (rep->r_flags & R_SOFTTERM)
@@ -549,7 +549,7 @@
 			auio.uio_resid = len;
 			do {
 			    rcvflg = MSG_WAITALL;
-			    error =  soreceive(so, (struct mbuf **)0,
+			    error =  (*so->so_receive)(so, (struct mbuf **)0,
 				&auio, mp, (struct mbuf **)0, &rcvflg);
 			} while (error == EWOULDBLOCK || error == EINTR ||
 				 error == ERESTART);
@@ -574,7 +574,7 @@
 			auio.uio_procp = p;
 			do {
 			    rcvflg = 0;
-			    error =  soreceive(so, (struct mbuf **)0,
+			    error =  (*so->so_receive)(so, (struct mbuf **)0,
 				&auio, mp, &control, &rcvflg);
 			    if (control)
 				m_freem(control);
@@ -618,7 +618,7 @@
 		auio.uio_procp = p;
 		do {
 			rcvflg = 0;
-			error =  soreceive(so, getnam, &auio, mp,
+			error =  (*so->so_receive)(so, getnam, &auio, mp,
 				(struct mbuf **)0, &rcvflg);
 			if (error == EWOULDBLOCK &&
 			    (rep->r_flags & R_SOFTTERM))
@@ -1839,7 +1839,7 @@
 		 */
 		auio.uio_resid = 1000000000;
 		flags = MSG_DONTWAIT;
-		error = soreceive(so, &nam, &auio, &mp, (struct mbuf **)0, &flags);
+		error = (*so->so_receive)(so, &nam, &auio, &mp, (struct mbuf **)0, &flags);
 		if (error || mp == (struct mbuf *)0) {
 			if (error == EWOULDBLOCK)
 				slp->ns_flag |= SLP_NEEDQ;
@@ -1873,7 +1873,7 @@
 		do {
 			auio.uio_resid = 1000000000;
 			flags = MSG_DONTWAIT;
-			error = soreceive(so, &nam, &auio, &mp,
+			error = (*so->so_receive)(so, &nam, &auio, &mp,
 						(struct mbuf **)0, &flags);
 			if (mp) {
 				if (nam) {
--- a/sys/nfs/nfs_syscalls.c	Sat Apr 25 17:35:18 1998 +0000
+++ b/sys/nfs/nfs_syscalls.c	Sat Apr 25 17:41:01 1998 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_syscalls.c,v 1.28 1998/02/19 00:54:13 thorpej Exp $	*/
+/*	$NetBSD: nfs_syscalls.c,v 1.29 1998/04/25 17:41:01 matt Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -443,6 +443,7 @@
 	s = splsoftnet();
 	so->so_upcallarg = (caddr_t)slp;
 	so->so_upcall = nfsrv_rcv;
+	so->so_rcv.sb_flags |= SB_UPCALL;
 	slp->ns_flag = (SLP_VALID | SLP_NEEDQ);
 	nfsrv_wakenfsd(slp);
 	splx(s);
@@ -755,6 +756,8 @@
 		slp->ns_fp = (struct file *)0;
 		so = slp->ns_so;
 		so->so_upcall = NULL;
+		so->so_upcallarg = NULL;
+		so->so_rcv.sb_flags &= ~SB_UPCALL;
 		soshutdown(so, 2);
 		closef(fp, (struct proc *)0);
 		if (slp->ns_nam)