/* If the system is REALLY out of memory this function returns 0, otherwise 1.  */
int idr_pre_get(struct idr *idp, gfp_t gfp_mask)
/* If the system is REALLY out of memory this function returns 0, otherwise 1.  */
int idr_pre_get(struct idr *idp, gfp_t gfp_mask)
{
	while (idp->id_free_cnt < IDR_FREE_MAX) {
		struct idr_layer *new;
		new = kmem_cache_zalloc(idr_layer_cache, gfp_mask);
		if (new == NULL)
			return (0);
		move_to_free_list(idp, new);
	}
	return 1;
}