/* This function returns the number of empty LEBs needed to commit @cnt znodes to the current index head. The number is not exact and may be more than needed.  */
static int get_leb_cnt(struct ubifs_info *c, int cnt)
/* This function returns the number of empty LEBs needed to commit @cnt znodes to the current index head. The number is not exact and may be more than needed.  */
static int get_leb_cnt(struct ubifs_info *c, int cnt)
{
	int d;
	cnt -= (c->leb_size - c->ihead_offs) / c->max_idx_node_sz;
	if (cnt < 0)
		cnt = 0;
	d = c->leb_size / c->max_idx_node_sz;
	return DIV_ROUND_UP(cnt, d);
}