FreeBSD/sys/dev/xen/blkback/blkback.c
/**
 * Given a page number and 512b sector offset within that page,
 * calculate an offset into the request's memory region that the
 * underlying backend device/file should use for I/O.
 *
 * \param reqlist The request structure whose I/O region will be accessed.
 * \param pagenr  The page index used to compute the I/O offset.
 * \param sector  The 512b sector index used to compute the page relative
 *                I/O offset.
 *
 * \return  The computed global I/O address.
 *
 * Depending on configuration, this will either be a local bounce buffer
 * or a pointer to the memory mapped in from the front-end domain for
 * this request.
 */
Given a page number and 512b sector offset within that page,
calculate an offset into the request's memory region that the
underlying backend device/file should use for I/O.

\param reqlist The request structure whose I/O region will be accessed.
\param pagenr  The page index used to compute the I/O offset.
\param sector  The 512b sector index used to compute the page relative
I/O offset.

\return  The computed global I/O address.

Depending on configuration, this will either be a local bounce buffer
or a pointer to the memory mapped in from the front-end domain for
this request.
Given a page number and 512b sector offset within that page calculate an offset into the request ' s memory region that the underlying backend device / file should use for I / O . \ param reqlist The request structure whose I / O region will be accessed . \ param pagenr The page index used to compute the I / O offset . \ param sector The 512b sector index used to compute the page relative I / O offset . \ return The computed global I / O address . Depending on configuration this will either be a local bounce buffer or a pointer to the memory mapped in from the front - end domain for this request .
static inline uint8_t *
xbb_reqlist_ioaddr(struct xbb_xen_reqlist *reqlist, int pagenr, int sector)
{
#ifdef XBB_USE_BOUNCE_BUFFERS
	return (xbb_reqlist_bounce_addr(reqlist, pagenr, sector));
#else
	return (xbb_reqlist_vaddr(reqlist, pagenr, sector));
#endif
}
static inline uint8_t * xbb_reqlist_ioaddr ( struct xbb_xen_reqlist * reqlist , int pagenr , int sector ) { #ifdef XBB_USE_BOUNCE_BUFFERS return ( xbb_reqlist_bounce_addr ( reqlist , pagenr , sector ) ) ; #else return ( xbb_reqlist_vaddr ( reqlist , pagenr , sector ) ) ; #endif }
Given a page number and 512b sector offset within that page,
 calculate an offset into the request's memory region that the
 underlying backend device/file should use for I/O.
Given a page number and 512b sector offset within that page calculate an offset into the request ' s memory region that the underlying backend device / file should use for I / O .