From owner-p4-projects@FreeBSD.ORG Mon Jun 1 10:42:50 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D90D61065675; Mon, 1 Jun 2009 10:42:49 +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 960111065674 for ; Mon, 1 Jun 2009 10:42:49 +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 83B438FC14 for ; Mon, 1 Jun 2009 10:42:49 +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 n51AgnDc055605 for ; Mon, 1 Jun 2009 10:42:49 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n51Agnnw055603 for perforce@freebsd.org; Mon, 1 Jun 2009 10:42:49 GMT (envelope-from zec@fer.hr) Date: Mon, 1 Jun 2009 10:42:49 GMT Message-Id: <200906011042.n51Agnnw055603@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 163244 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: Mon, 01 Jun 2009 10:42:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=163244 Change 163244 by zec@zec_amdx4 on 2009/06/01 10:42:40 Fix misintegrations and reduce diff against head. Affected files ... .. //depot/projects/vimage/src/sys/kern/uipc_socket.c#35 edit .. //depot/projects/vimage/src/sys/net/if_clone.c#16 edit Differences ... ==== //depot/projects/vimage/src/sys/kern/uipc_socket.c#35 (text+ko) ==== @@ -288,7 +288,6 @@ #ifdef VIMAGE ++vnet->sockcnt; /* Locked with so_global_mtx. */ so->so_vnet = vnet; - vnet->sockcnt++; #endif mtx_unlock(&so_global_mtx); return (so); @@ -361,11 +360,7 @@ if (prp->pr_type != type) return (EPROTOTYPE); -#ifdef VIMAGE so = soalloc(TD_TO_VNET(td)); -#else - so = soalloc(NULL); -#endif if (so == NULL) return (ENOBUFS); @@ -435,12 +430,8 @@ if (over) #endif return (NULL); -#ifdef VIMAGE VNET_ASSERT(head->so_vnet); so = soalloc(head->so_vnet); -#else - so = soalloc(NULL); -#endif if (so == NULL) return (NULL); if ((head->so_options & SO_ACCEPTFILTER) != 0) @@ -2065,7 +2056,7 @@ soshutdown(struct socket *so, int how) { struct protosw *pr = so->so_proto; - int error = 0; + int error; if (!(how == SHUT_RD || how == SHUT_WR || how == SHUT_RDWR)) return (EINVAL); @@ -2078,8 +2069,9 @@ CURVNET_SET(so->so_vnet); error = (*pr->pr_usrreqs->pru_shutdown)(so); CURVNET_RESTORE(); + return (error); } - return (error); + return (0); } void ==== //depot/projects/vimage/src/sys/net/if_clone.c#16 (text+ko) ==== @@ -459,24 +459,6 @@ * Find a free unit if none was given. */ if (wildcard) { -#ifdef VIMAGE - INIT_VNET_NET(curvnet); - char name[IFNAMSIZ]; - struct ifnet *ifp; - int i = 0; - - IFNET_RLOCK(); -again: - TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - sprintf(name, "%s%d", ifc->ifc_name, i); - if (strcmp(name, ifp->if_xname) == 0) { - i++; - goto again; - } - } - IFNET_RUNLOCK(); - *unit = i; -#else while ((bytoff < ifc->ifc_bmlen) && (ifc->ifc_units[bytoff] == 0xff)) bytoff++; @@ -487,7 +469,6 @@ while ((ifc->ifc_units[bytoff] & (1 << bitoff)) != 0) bitoff++; *unit = (bytoff << 3) + bitoff; -#endif } if (*unit > ifc->ifc_maxunit) { @@ -495,7 +476,6 @@ goto done; } -#ifndef VIMAGE if (!wildcard) { bytoff = *unit >> 3; bitoff = *unit - (bytoff << 3); @@ -511,7 +491,6 @@ KASSERT((ifc->ifc_units[bytoff] & (1 << bitoff)) == 0, ("%s: bit is already set", __func__)); ifc->ifc_units[bytoff] |= (1 << bitoff); -#endif IF_CLONE_ADDREF_LOCKED(ifc); done: @@ -522,7 +501,6 @@ void ifc_free_unit(struct if_clone *ifc, int unit) { -#ifndef VIMAGE int bytoff, bitoff; @@ -537,7 +515,6 @@ ("%s: bit is already cleared", __func__)); ifc->ifc_units[bytoff] &= ~(1 << bitoff); IF_CLONE_REMREF_LOCKED(ifc); /* releases lock */ -#endif } void