/* Insert new item(s) into the extent records for incore inode fork 'ifp'. 'count' new items are inserted at index 'idx'.  */
void xfs_iext_insert(xfs_inode_t *ip, xfs_extnum_t idx, xfs_extnum_t count, xfs_bmbt_irec_t *new, int state)
/* Insert new item(s) into the extent records for incore inode fork 'ifp'. 'count' new items are inserted at index 'idx'.  */
void xfs_iext_insert(xfs_inode_t *ip, xfs_extnum_t idx, xfs_extnum_t count, xfs_bmbt_irec_t *new, int state)
{
	xfs_ifork_t	*ifp = (state & BMAP_ATTRFORK) ? ip->i_afp : &ip->i_df;
	xfs_extnum_t	i;
	trace_xfs_iext_insert(ip, idx, new, state, _RET_IP_);
	ASSERT(ifp->if_flags & XFS_IFEXTENTS);
	xfs_iext_add(ifp, idx, count);
	for (i = idx; i < idx + count; i++, new++)
		xfs_bmbt_set_all(xfs_iext_get_ext(ifp, i), new);
}