FreeBSD/sys/kern/kern_sendfile.c
/*
 * Helper function to calculate how much data to put into page i of n.
 * Only first and last pages are special.
 */
Helper function to calculate how much data to put into page i of n.
Only first and last pages are special.
Helper function to calculate how much data to put into page i of n . Only first and last pages are special .
static inline off_t
xfsize(int i, int n, off_t off, off_t len)
{
	if (i == 0)
		return (omin(PAGE_SIZE - (off & PAGE_MASK), len));
	if (i == n - 1 && ((off + len) & PAGE_MASK) > 0)
		return ((off + len) & PAGE_MASK);
	return (PAGE_SIZE);
}
static inline off_t xfsize ( int i , int n , off_t off , off_t len ) { if ( i == 0 ) return ( omin ( PAGE_SIZE - ( off & PAGE_MASK ) , len ) ) ; if ( i == n - 1 && ( ( off + len ) & PAGE_MASK ) > 0 ) return ( ( off + len ) & PAGE_MASK ) ; return ( PAGE_SIZE ) ; }
Helper function to calculate how much data to put into page i of n.
 Only first and last pages are special.
Helper function to calculate how much data to put into page i of n . Only first and last pages are special .