ng_base.c (249583) | ng_base.c (253346) |
---|---|
1/*- 2 * Copyright (c) 1996-1999 Whistle Communications, Inc. 3 * All rights reserved. 4 * 5 * Subject to the following obligations and disclaimer of warranty, use and 6 * redistribution of this software, in source or object code forms, with or 7 * without modifications are expressly permitted by Whistle Communications; 8 * provided, however, that: --- 20 unchanged lines hidden (view full) --- 29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 31 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 32 * OF SUCH DAMAGE. 33 * 34 * Authors: Julian Elischer <julian@freebsd.org> 35 * Archie Cobbs <archie@freebsd.org> 36 * | 1/*- 2 * Copyright (c) 1996-1999 Whistle Communications, Inc. 3 * All rights reserved. 4 * 5 * Subject to the following obligations and disclaimer of warranty, use and 6 * redistribution of this software, in source or object code forms, with or 7 * without modifications are expressly permitted by Whistle Communications; 8 * provided, however, that: --- 20 unchanged lines hidden (view full) --- 29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 31 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 32 * OF SUCH DAMAGE. 33 * 34 * Authors: Julian Elischer <julian@freebsd.org> 35 * Archie Cobbs <archie@freebsd.org> 36 * |
37 * $FreeBSD: head/sys/netgraph/ng_base.c 249583 2013-04-17 11:42:40Z gabor $ | 37 * $FreeBSD: head/sys/netgraph/ng_base.c 253346 2013-07-15 01:32:55Z rodrigc $ |
38 * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $ 39 */ 40 41/* 42 * This file implements the base netgraph code. 43 */ 44 45#include <sys/param.h> --- 738 unchanged lines hidden (view full) --- 784 */ 785void 786ng_unref_node(node_p node) 787{ 788 789 if (node == &ng_deadnode) 790 return; 791 | 38 * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $ 39 */ 40 41/* 42 * This file implements the base netgraph code. 43 */ 44 45#include <sys/param.h> --- 738 unchanged lines hidden (view full) --- 784 */ 785void 786ng_unref_node(node_p node) 787{ 788 789 if (node == &ng_deadnode) 790 return; 791 |
792 CURVNET_SET(node->nd_vnet); 793 |
|
792 if (refcount_release(&node->nd_refs)) { /* we were the last */ 793 794 node->nd_type->refs--; /* XXX maybe should get types lock? */ 795 NAMEHASH_WLOCK(); 796 if (NG_NODE_HAS_NAME(node)) { 797 V_ng_named_nodes--; 798 LIST_REMOVE(node, nd_nodes); 799 } 800 NAMEHASH_WUNLOCK(); 801 802 IDHASH_WLOCK(); 803 V_ng_nodes--; 804 LIST_REMOVE(node, nd_idnodes); 805 IDHASH_WUNLOCK(); 806 807 mtx_destroy(&node->nd_input_queue.q_mtx); 808 NG_FREE_NODE(node); 809 } | 794 if (refcount_release(&node->nd_refs)) { /* we were the last */ 795 796 node->nd_type->refs--; /* XXX maybe should get types lock? */ 797 NAMEHASH_WLOCK(); 798 if (NG_NODE_HAS_NAME(node)) { 799 V_ng_named_nodes--; 800 LIST_REMOVE(node, nd_nodes); 801 } 802 NAMEHASH_WUNLOCK(); 803 804 IDHASH_WLOCK(); 805 V_ng_nodes--; 806 LIST_REMOVE(node, nd_idnodes); 807 IDHASH_WUNLOCK(); 808 809 mtx_destroy(&node->nd_input_queue.q_mtx); 810 NG_FREE_NODE(node); 811 } |
812 CURVNET_RESTORE(); |
|
810} 811 812/************************************************************************ 813 Node ID handling 814************************************************************************/ 815static node_p 816ng_ID2noderef(ng_ID_t ID) 817{ --- 3024 unchanged lines hidden --- | 813} 814 815/************************************************************************ 816 Node ID handling 817************************************************************************/ 818static node_p 819ng_ID2noderef(ng_ID_t ID) 820{ --- 3024 unchanged lines hidden --- |