FreeBSD/sys/netpfil/ipfw/dn_sched_fq_pie.c
/* 
 * callout function to destroy PIE lock, and free fq_pie flows and fq_pie si
 * extra memory when number of active sub-queues reaches zero.
 * 'x' is a fq_pie_flow to be destroyed
 */
callout function to destroy PIE lock, and free fq_pie flows and fq_pie si
extra memory when number of active sub-queues reaches zero.
'x' is a fq_pie_flow to be destroyed
callout function to destroy PIE lock and free fq_pie flows and fq_pie si extra memory when number of active sub - queues reaches zero . ' x ' is a fq_pie_flow to be destroyed
static void
fqpie_callout_cleanup(void *x)
{
	struct fq_pie_flow *q = x;
	struct pie_status *pst = &q->pst;
	struct fq_pie_si_extra *psi_extra;
	mtx_unlock(&pst->lock_mtx);
	mtx_destroy(&pst->lock_mtx);
	psi_extra = q->psi_extra;
	DN_BH_WLOCK();
	psi_extra->nr_active_q--;
	if (!psi_extra->nr_active_q) {
		free(psi_extra->flows, M_DUMMYNET);
		free(psi_extra, M_DUMMYNET);
		fq_pie_desc.ref_count--;
	}
	DN_BH_WUNLOCK();
}
static void fqpie_callout_cleanup ( void * x ) { struct fq_pie_flow * q = x ; struct pie_status * pst = & q -> pst ; struct fq_pie_si_extra * psi_extra ; mtx_unlock ( & pst -> lock_mtx ) ; mtx_destroy ( & pst -> lock_mtx ) ; psi_extra = q -> psi_extra ; DN_BH_WLOCK ( ) ; psi_extra -> nr_active_q -- ; if ( ! psi_extra -> nr_active_q ) { free ( psi_extra -> flows , M_DUMMYNET ) ; free ( psi_extra , M_DUMMYNET ) ; fq_pie_desc . ref_count -- ; } DN_BH_WUNLOCK ( ) ; }
callout function to destroy PIE lock, and free fq_pie flows and fq_pie si
 extra memory when number of active sub-queues reaches zero.
callout function to destroy PIE lock and free fq_pie flows and fq_pie si extra memory when number of active sub - queues reaches zero .
/* when all sub-queues are destroyed, free flows fq_pie extra vars memory */