FreeBSD/sys/dev/xen/blkback/blkback.c
/**
 * Return an allocated transaction tracking structure to the free pool.
 *
 * \param xbb        Per-instance xbb configuration structure.
 * \param req        The request list structure to free.
 * \param wakeup     If set, wakeup the work thread if freeing this reqlist
 *                   during a resource shortage condition.
 */
Return an allocated transaction tracking structure to the free pool.
\param xbb        Per-instance xbb configuration structure.
\param req        The request list structure to free.
\param wakeup     If set, wakeup the work thread if freeing this reqlist
during a resource shortage condition.
Return an allocated transaction tracking structure to the free pool . \ param xbb Per - instance xbb configuration structure . \ param req The request list structure to free . \ param wakeup If set wakeup the work thread if freeing this reqlist during a resource shortage condition .
static inline void
xbb_release_reqlist(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist,
		    int wakeup)
{
	mtx_assert(&xbb->lock, MA_OWNED);
	if (wakeup) {
		wakeup = xbb->flags & XBBF_RESOURCE_SHORTAGE;
		xbb->flags &= ~XBBF_RESOURCE_SHORTAGE;
	}
	if (reqlist->kva != NULL)
		xbb_free_kva(xbb, reqlist->kva, reqlist->nr_segments);
	xbb_release_reqs(xbb, &reqlist->contig_req_list, reqlist->num_children);
	STAILQ_INSERT_TAIL(&xbb->reqlist_free_stailq, reqlist, links);
	if ((xbb->flags & XBBF_SHUTDOWN) != 0) {
		xbb_shutdown(xbb);
	}
	if (wakeup != 0)
		taskqueue_enqueue(xbb->io_taskqueue, &xbb->io_task); 
}
static inline void xbb_release_reqlist ( struct xbb_softc * xbb , struct xbb_xen_reqlist * reqlist , int wakeup ) { mtx_assert ( & xbb -> lock , MA_OWNED ) ; if ( wakeup ) { wakeup = xbb -> flags & XBBF_RESOURCE_SHORTAGE ; xbb -> flags &= ~ XBBF_RESOURCE_SHORTAGE ; } if ( reqlist -> kva != NULL ) xbb_free_kva ( xbb , reqlist -> kva , reqlist -> nr_segments ) ; xbb_release_reqs ( xbb , & reqlist -> contig_req_list , reqlist -> num_children ) ; STAILQ_INSERT_TAIL ( & xbb -> reqlist_free_stailq , reqlist , links ) ; if ( ( xbb -> flags & XBBF_SHUTDOWN ) != 0 ) { xbb_shutdown ( xbb ) ; } if ( wakeup != 0 ) taskqueue_enqueue ( xbb -> io_taskqueue , & xbb -> io_task ) ; }
Return an allocated transaction tracking structure to the free pool.
Return an allocated transaction tracking structure to the free pool .
/*
		 * Shutdown is in progress.  See if we can
		 * progress further now that one more request
		 * has completed and been returned to the
		 * free pool.
		 */