/* Switch from inline buffer to linear (direct) extent records. new_size should already be rounded up to the next power of 2 by the caller (when appropriate), so use new_size as it is. However, since new_size may be rounded up, we can't update if_bytes here. It is the caller's responsibility to update if_bytes upon return.  */
void xfs_iext_inline_to_direct(xfs_ifork_t *ifp, int new_size)
/* Switch from inline buffer to linear (direct) extent records. new_size should already be rounded up to the next power of 2 by the caller (when appropriate), so use new_size as it is. However, since new_size may be rounded up, we can't update if_bytes here. It is the caller's responsibility to update if_bytes upon return.  */
void xfs_iext_inline_to_direct(xfs_ifork_t *ifp, int new_size)
{
	ifp->if_u1.if_extents = kmem_alloc(new_size, KM_NOFS);
	memset(ifp->if_u1.if_extents, 0, new_size);
	if (ifp->if_bytes) {
		memcpy(ifp->if_u1.if_extents, ifp->if_u2.if_inline_ext,
			ifp->if_bytes);
		memset(ifp->if_u2.if_inline_ext, 0, XFS_INLINE_EXTS *
			sizeof(xfs_bmbt_rec_t));
	}
	ifp->if_real_bytes = new_size;
}