/* Resize an extent indirection array to new_size bytes.  */
STATIC void xfs_iext_realloc_indirect(xfs_ifork_t *ifp, int new_size)
/* Resize an extent indirection array to new_size bytes.  */
STATIC void xfs_iext_realloc_indirect(xfs_ifork_t *ifp, int new_size)
{
	int		nlists;
	int		size;
	ASSERT(ifp->if_flags & XFS_IFEXTIREC);
	nlists = ifp->if_real_bytes / XFS_IEXT_BUFSZ;
	size = nlists * sizeof(xfs_ext_irec_t);
	ASSERT(ifp->if_real_bytes);
	ASSERT((new_size >= 0) && (new_size != size));
	if (new_size == 0) {
		xfs_iext_destroy(ifp);
	} else {
		ifp->if_u1.if_ext_irec = (xfs_ext_irec_t *)
			kmem_realloc(ifp->if_u1.if_ext_irec,
				new_size, size, KM_NOFS);
	}
}