FreeBSD/sys/dev/xen/blkback/blkback.c
/**
 * Allocate an internal transaction tracking structure from the free pool.
 *
 * \param xbb  Per-instance xbb configuration structure.
 *
 * \return  On success, a pointer to the allocated xbb_xen_reqlist structure.
 *          Otherwise NULL.
 */
Allocate an internal transaction tracking structure from the free pool.
\param xbb  Per-instance xbb configuration structure.

\return  On success, a pointer to the allocated xbb_xen_reqlist structure.
Otherwise NULL.
Allocate an internal transaction tracking structure from the free pool . \ param xbb Per - instance xbb configuration structure . \ return On success a pointer to the allocated xbb_xen_reqlist structure . Otherwise NULL .
static inline struct xbb_xen_reqlist *
xbb_get_reqlist(struct xbb_softc *xbb)
{
	struct xbb_xen_reqlist *reqlist;
	reqlist = NULL;
	mtx_assert(&xbb->lock, MA_OWNED);
	if ((reqlist = STAILQ_FIRST(&xbb->reqlist_free_stailq)) != NULL) {
		STAILQ_REMOVE_HEAD(&xbb->reqlist_free_stailq, links);
		reqlist->flags = XBB_REQLIST_NONE;
		reqlist->kva = NULL;
		reqlist->status = BLKIF_RSP_OKAY;
		reqlist->residual_512b_sectors = 0;
		reqlist->num_children = 0;
		reqlist->nr_segments = 0;
		STAILQ_INIT(&reqlist->contig_req_list);
	}
	return (reqlist);
}
static inline struct xbb_xen_reqlist * xbb_get_reqlist ( struct xbb_softc * xbb ) { struct xbb_xen_reqlist * reqlist ; reqlist = NULL ; mtx_assert ( & xbb -> lock , MA_OWNED ) ; if ( ( reqlist = STAILQ_FIRST ( & xbb -> reqlist_free_stailq ) ) != NULL ) { STAILQ_REMOVE_HEAD ( & xbb -> reqlist_free_stailq , links ) ; reqlist -> flags = XBB_REQLIST_NONE ; reqlist -> kva = NULL ; reqlist -> status = BLKIF_RSP_OKAY ; reqlist -> residual_512b_sectors = 0 ; reqlist -> num_children = 0 ; reqlist -> nr_segments = 0 ; STAILQ_INIT ( & reqlist -> contig_req_list ) ; } return ( reqlist ) ; }
Allocate an internal transaction tracking structure from the free pool.
Allocate an internal transaction tracking structure from the free pool .