/* ubi_calculate_rsvd_pool - calculate how many PEBs must be reserved for bad eraseblock handling. @ubi: UBI device description object  */
void ubi_calculate_reserved(struct ubi_device *ubi)
/* ubi_calculate_rsvd_pool - calculate how many PEBs must be reserved for bad eraseblock handling. @ubi: UBI device description object  */
void ubi_calculate_reserved(struct ubi_device *ubi)
{
	ubi->beb_rsvd_level = ubi->good_peb_count/100;
	ubi->beb_rsvd_level *= CONFIG_MTD_UBI_BEB_RESERVE;
	if (ubi->beb_rsvd_level < MIN_RESEVED_PEBS)
		ubi->beb_rsvd_level = MIN_RESEVED_PEBS;
}