From owner-p4-projects@FreeBSD.ORG Mon Jun 2 12:51:42 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F07C71065675; Mon, 2 Jun 2008 12:51:41 +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 B29AF1065672 for ; Mon, 2 Jun 2008 12:51:41 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B021B8FC1E for ; Mon, 2 Jun 2008 12:51:41 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m52CpfUu046639 for ; Mon, 2 Jun 2008 12:51:41 GMT (envelope-from zec@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m52CpftR046637 for perforce@freebsd.org; Mon, 2 Jun 2008 12:51:41 GMT (envelope-from zec@FreeBSD.org) Date: Mon, 2 Jun 2008 12:51:41 GMT Message-Id: <200806021251.m52CpftR046637@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@FreeBSD.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 142751 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, 02 Jun 2008 12:51:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=142751 Change 142751 by zec@zec_tca51 on 2008/06/02 12:51:04 Unbreak netgraph compilation. Affected files ... .. //depot/projects/vimage/src/sys/netgraph/ng_base.c#27 edit .. //depot/projects/vimage/src/sys/netgraph/vnetgraph.h#7 edit Differences ... ==== //depot/projects/vimage/src/sys/netgraph/ng_base.c#27 (text+ko) ==== @@ -170,11 +170,12 @@ /* Hash related definitions */ /* XXX Don't need to initialise them because it's a LIST */ -#define NG_ID_HASH_SIZE 128 /* most systems wont need even this many */ #ifndef VIMAGE static LIST_HEAD(, ng_node) ng_ID_hash[NG_ID_HASH_SIZE]; +static LIST_HEAD(, ng_node) ng_name_hash[NG_NAME_HASH_SIZE]; #endif static struct mtx ng_idhash_mtx; +static struct mtx ng_namehash_mtx; /* Method to find a node.. used twice so do it here */ #define NG_IDHASH_FN(ID) ((ID) % (NG_ID_HASH_SIZE)) #define NG_IDHASH_FIND(ID, node) \ @@ -189,9 +190,6 @@ } \ } while (0) -#define NG_NAME_HASH_SIZE 128 /* most systems wont need even this many */ -static LIST_HEAD(, ng_node) ng_name_hash[NG_NAME_HASH_SIZE]; -static struct mtx ng_namehash_mtx; #define NG_NAMEHASH(NAME, HASH) \ do { \ u_char h = 0; \ @@ -838,6 +836,7 @@ int ng_name_node(node_p node, const char *name) { + INIT_VNET_NETGRAPH(curvnet); int i, hash; node_p node2; @@ -869,7 +868,7 @@ NG_NAMEHASH(name, hash); mtx_lock(&ng_namehash_mtx); LIST_REMOVE(node, nd_nodes); - LIST_INSERT_HEAD(&ng_name_hash[hash], node, nd_nodes); + LIST_INSERT_HEAD(&V_ng_name_hash[hash], node, nd_nodes); mtx_unlock(&ng_namehash_mtx); return (0); @@ -3113,7 +3112,7 @@ { INIT_VNET_NETGRAPH(curvnet); - LIST_INIT(&V_ng_nodelist); + LIST_INIT(&V_ng_nodelist); /* XXX should go away */ V_nextID = 1; return 0; ==== //depot/projects/vimage/src/sys/netgraph/vnetgraph.h#7 (text+ko) ==== @@ -42,10 +42,12 @@ #define VNET_NETGRAPH(sym) VSYM(vnet_netgraph, sym) #define NG_ID_HASH_SIZE 32 /* most systems wont need even this many */ +#define NG_NAME_HASH_SIZE 128 /* most systems wont need even this many */ #ifdef VIMAGE struct vnet_netgraph { LIST_HEAD(, ng_node) _ng_ID_hash[NG_ID_HASH_SIZE]; + LIST_HEAD(, ng_node) _ng_name_hash[NG_ID_HASH_SIZE]; LIST_HEAD(, ng_node) _ng_nodelist; ng_ID_t _nextID; struct unrhdr *_ng_iface_unit; @@ -56,6 +58,7 @@ /* Symbol translation macros */ #define V_ng_ID_hash VNET_NETGRAPH(ng_ID_hash) +#define V_ng_name_hash VNET_NETGRAPH(ng_name_hash) #define V_ng_nodelist VNET_NETGRAPH(ng_nodelist) #define V_nextID VNET_NETGRAPH(nextID) #define V_ng_iface_unit VNET_NETGRAPH(ng_iface_unit)