/* This is a helper function for 'ubifs_rcvry_gc_commit()' which grabs an empty LEB to be used as GC LEB ( */
static int grab_empty_leb(struct ubifs_info *c)
/* This is a helper function for 'ubifs_rcvry_gc_commit()' which grabs an empty LEB to be used as GC LEB ( */
static int grab_empty_leb(struct ubifs_info *c)
{
	int lnum, err;
	lnum = ubifs_find_free_leb_for_idx(c);
	if (lnum < 0) {
		ubifs_err(c, "could not find an empty LEB");
		ubifs_dump_lprops(c);
		ubifs_dump_budg(c, &c->bi);
		return lnum;
	}
	err = ubifs_change_one_lp(c, lnum, LPROPS_NC, LPROPS_NC, 0,
				  LPROPS_INDEX, 0);
	if (err)
		return err;
	c->gc_lnum = lnum;
	dbg_rcvry("found empty LEB %d, run commit", lnum);
	return ubifs_run_commit(c);
}