From owner-p4-projects@FreeBSD.ORG Sat Jun 27 14:19:56 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 06A5C1065670; Sat, 27 Jun 2009 14:19:56 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B72401065675 for ; Sat, 27 Jun 2009 14:19:55 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A52A18FC1F for ; Sat, 27 Jun 2009 14:19:55 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n5REJtCI038544 for ; Sat, 27 Jun 2009 14:19:55 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5REJtva038542 for perforce@freebsd.org; Sat, 27 Jun 2009 14:19:55 GMT (envelope-from zec@fer.hr) Date: Sat, 27 Jun 2009 14:19:55 GMT Message-Id: <200906271419.n5REJtva038542@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 165308 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jun 2009 14:19:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=165308 Change 165308 by zec@zec_amdx4 on 2009/06/27 14:19:06 Reshuffle CURVNET_SET() / CURVNET_RESTORE() placement in order to mitigate recursion on curvnet and the associated console noise. Affected files ... .. //depot/projects/vimage-commit2/src/sys/nfsserver/nfs_srvkrpc.c#12 edit .. //depot/projects/vimage-commit2/src/sys/rpc/svc_dg.c#5 edit .. //depot/projects/vimage-commit2/src/sys/rpc/svc_generic.c#4 edit .. //depot/projects/vimage-commit2/src/sys/rpc/svc_vc.c#9 edit Differences ... ==== //depot/projects/vimage-commit2/src/sys/nfsserver/nfs_srvkrpc.c#12 (text+ko) ==== @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include @@ -62,7 +61,6 @@ #include #include #include -#include #include #include @@ -459,12 +457,10 @@ * Steal the socket from userland so that it doesn't close * unexpectedly. */ - CURVNET_SET(TD_TO_VNET(td)); if (so->so_type == SOCK_DGRAM) xprt = svc_dg_create(nfsrv_pool, so, 0, 0); else xprt = svc_vc_create(nfsrv_pool, so, 0, 0); - CURVNET_RESTORE(); if (xprt) { fp->f_ops = &badfileops; fp->f_data = NULL; ==== //depot/projects/vimage-commit2/src/sys/rpc/svc_dg.c#5 (text+ko) ==== @@ -128,6 +128,7 @@ xprt->xp_ops = &svc_dg_ops; error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); + CURVNET_RESTORE(); if (error) goto freedata; @@ -146,7 +147,6 @@ if (xprt) { svc_xprt_free(xprt); } - CURVNET_RESTORE(); return (NULL); } ==== //depot/projects/vimage-commit2/src/sys/rpc/svc_generic.c#4 (text+ko) ==== @@ -48,6 +48,7 @@ #include "opt_inet6.h" #include +#include #include #include #include @@ -59,6 +60,7 @@ #include #include #include +#include #include #include @@ -228,11 +230,14 @@ /* * It is an open socket. Get the transport info. */ + CURVNET_SET(so->so_vnet); if (!__rpc_socket2sockinfo(so, &si)) { printf( "svc_tli_create: could not get transport information\n"); + CURVNET_RESTORE(); return (NULL); } + CURVNET_RESTORE(); } /* @@ -259,7 +264,9 @@ "svc_tli_create: could not bind to requested address\n"); goto freedata; } + CURVNET_SET(so->so_vnet); solisten(so, (int)bindaddr->qlen, curthread); + CURVNET_RESTORE(); } } ==== //depot/projects/vimage-commit2/src/sys/rpc/svc_vc.c#9 (text+ko) ==== @@ -153,9 +153,12 @@ xprt->xp_p2 = NULL; xprt->xp_ops = &svc_vc_rendezvous_ops; + CURVNET_SET(so->so_vnet); error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); - if (error) + if (error) { + CURVNET_RESTORE(); goto cleanup_svc_vc_create; + } memcpy(&xprt->xp_ltaddr, sa, sa->sa_len); free(sa, M_SONAME); @@ -163,6 +166,7 @@ xprt_register(xprt); solisten(so, SOMAXCONN, curthread); + CURVNET_RESTORE(); SOCKBUF_LOCK(&so->so_rcv); xprt->xp_upcallset = 1; @@ -195,9 +199,12 @@ opt.sopt_name = SO_KEEPALIVE; opt.sopt_val = &one; opt.sopt_valsize = sizeof(one); + CURVNET_SET(so->so_vnet); error = sosetopt(so, &opt); - if (error) + if (error) { + CURVNET_RESTORE(); return (NULL); + } if (so->so_proto->pr_protocol == IPPROTO_TCP) { bzero(&opt, sizeof(struct sockopt)); @@ -207,9 +214,12 @@ opt.sopt_val = &one; opt.sopt_valsize = sizeof(one); error = sosetopt(so, &opt); - if (error) + if (error) { + CURVNET_RESTORE(); return (NULL); + } } + CURVNET_RESTORE(); cd = mem_alloc(sizeof(*cd)); cd->strm_stat = XPRT_IDLE;