ng_base.c (151256) | ng_base.c (151283) |
---|---|
1/* 2 * ng_base.c 3 */ 4 5/*- 6 * Copyright (c) 1996-1999 Whistle Communications, Inc. 7 * All rights reserved. 8 * --- 24 unchanged lines hidden (view full) --- 33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 35 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 36 * OF SUCH DAMAGE. 37 * 38 * Authors: Julian Elischer <julian@freebsd.org> 39 * Archie Cobbs <archie@freebsd.org> 40 * | 1/* 2 * ng_base.c 3 */ 4 5/*- 6 * Copyright (c) 1996-1999 Whistle Communications, Inc. 7 * All rights reserved. 8 * --- 24 unchanged lines hidden (view full) --- 33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 35 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 36 * OF SUCH DAMAGE. 37 * 38 * Authors: Julian Elischer <julian@freebsd.org> 39 * Archie Cobbs <archie@freebsd.org> 40 * |
41 * $FreeBSD: head/sys/netgraph/ng_base.c 151256 2005-10-12 10:18:44Z glebius $ | 41 * $FreeBSD: head/sys/netgraph/ng_base.c 151283 2005-10-13 11:55:50Z glebius $ |
42 * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $ 43 */ 44 45/* 46 * This file implements the base netgraph code. 47 */ 48 49#include <sys/param.h> --- 2012 unchanged lines hidden (view full) --- 2062 add_arg += READ_PENDING; 2063 } else { 2064 add_arg += WRITE_PENDING; 2065 } 2066 } 2067 atomic_add_long(&ngq->q_flags, add_arg); 2068 2069 mtx_unlock_spin(&ngq->q_mtx); | 42 * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $ 43 */ 44 45/* 46 * This file implements the base netgraph code. 47 */ 48 49#include <sys/param.h> --- 2012 unchanged lines hidden (view full) --- 2062 add_arg += READ_PENDING; 2063 } else { 2064 add_arg += WRITE_PENDING; 2065 } 2066 } 2067 atomic_add_long(&ngq->q_flags, add_arg); 2068 2069 mtx_unlock_spin(&ngq->q_mtx); |
2070 if (item->apply != NULL) { 2071 (item->apply)(item->context, ENOENT); 2072 item->apply = NULL; 2073 } |
|
2070 NG_FREE_ITEM(item); 2071 mtx_lock_spin(&ngq->q_mtx); 2072 } 2073 /* 2074 * Take us off the work queue if we are there. 2075 * We definatly have no work to be done. 2076 */ 2077 ng_worklist_remove(ngq->q_node); --- 815 unchanged lines hidden (view full) --- 2893} 2894 2895/* 2896 * Release a queue entry 2897 */ 2898void 2899ng_free_item(item_p item) 2900{ | 2074 NG_FREE_ITEM(item); 2075 mtx_lock_spin(&ngq->q_mtx); 2076 } 2077 /* 2078 * Take us off the work queue if we are there. 2079 * We definatly have no work to be done. 2080 */ 2081 ng_worklist_remove(ngq->q_node); --- 815 unchanged lines hidden (view full) --- 2897} 2898 2899/* 2900 * Release a queue entry 2901 */ 2902void 2903ng_free_item(item_p item) 2904{ |
2905 KASSERT(item->apply == NULL, ("%s: leaking apply callback", __func__)); 2906 |
|
2901 /* 2902 * The item may hold resources on it's own. We need to free 2903 * these before we can free the item. What they are depends upon 2904 * what kind of item it is. it is important that nodes zero 2905 * out pointers to resources that they remove from the item 2906 * or we release them again here. 2907 */ 2908 switch (item->el_flags & NGQF_TYPE) { --- 719 unchanged lines hidden --- | 2907 /* 2908 * The item may hold resources on it's own. We need to free 2909 * these before we can free the item. What they are depends upon 2910 * what kind of item it is. it is important that nodes zero 2911 * out pointers to resources that they remove from the item 2912 * or we release them again here. 2913 */ 2914 switch (item->el_flags & NGQF_TYPE) { --- 719 unchanged lines hidden --- |