/* If the system is REALLY out of memory this function returns 0, otherwise 1.  */
int ida_pre_get(struct ida *ida, gfp_t gfp_mask)
/* If the system is REALLY out of memory this function returns 0, otherwise 1.  */
int ida_pre_get(struct ida *ida, gfp_t gfp_mask)
{
	if (!idr_pre_get(&ida->idr, gfp_mask))
		return 0;
	if (!ida->free_bitmap) {
		struct ida_bitmap *bitmap;
		bitmap = kmalloc(sizeof(struct ida_bitmap), gfp_mask);
		if (!bitmap)
			return 0;
		free_bitmap(ida, bitmap);
	}
	return 1;
}