netgraph7: Factor out and inline item reference counting code.
authorNuno Antunes <nuno.antunes@gmail.com>
Tue, 15 Jul 2014 02:16:18 +0000 (03:16 +0100)
committerNuno Antunes <nuno.antunes@gmail.com>
Wed, 16 Jul 2014 05:56:16 +0000 (06:56 +0100)
commitcfb360d8bbe9d8e418568a700ec597308a585f0b
tree41d5b1238c9ce1dffae85c8ff6dd4810bda2b541
parent11b81f5d7090a4c01df8c0e17a07b3a3d89b32be
netgraph7: Factor out and inline item reference counting code.

* Netgraph7 assumes that nodes synchronously consume the items passed to them,
  i.e. either 1) immediatly drop the item or 2) immediatly pass the item to the
  next node.

  The previous assumption is not true for nodes that have their own internal
  item queues and defer the processing of the item.  Such nodes can use these
  routines to prevent the items from being freed too early.

* Move the apply callback check into the item reference release code.
sys/netgraph7/netgraph.h
sys/netgraph7/netgraph/ng_base.c
sys/netgraph7/netgraph2.h