/* Switch from linear (direct) extent records to inline buffer.  */
void xfs_iext_direct_to_inline(xfs_ifork_t *ifp, xfs_extnum_t nextents)
/* Switch from linear (direct) extent records to inline buffer.  */
void xfs_iext_direct_to_inline(xfs_ifork_t *ifp, xfs_extnum_t nextents)
{
	ASSERT(ifp->if_flags & XFS_IFEXTENTS);
	ASSERT(nextents <= XFS_INLINE_EXTS);
	memcpy(ifp->if_u2.if_inline_ext, ifp->if_u1.if_extents,
		nextents * sizeof(xfs_bmbt_rec_t));
	kmem_free(ifp->if_u1.if_extents);
	ifp->if_u1.if_extents = ifp->if_u2.if_inline_ext;
	ifp->if_real_bytes = 0;
}