/* This function attempts to find an untaken index LEB with the most free and dirty space that can be used without overwriting index nodes that were in the last index committed.  */
int ubifs_find_dirty_idx_leb(struct ubifs_info *c)
/* This function attempts to find an untaken index LEB with the most free and dirty space that can be used without overwriting index nodes that were in the last index committed.  */
int ubifs_find_dirty_idx_leb(struct ubifs_info *c)
{
	int err;
	ubifs_get_lprops(c);
	err = find_dirtiest_idx_leb(c);
	if (err == -ENOSPC)
		err = find_dirty_idx_leb(c);
	if (err == -ENOSPC)
		err = get_idx_gc_leb(c);
	ubifs_release_lprops(c);
	return err;
}