/* If recovery is not required, then the orphans from the previous session are not needed. This function locates the LEBs used to record orphans, and un-maps them.  */
int ubifs_clear_orphans(struct ubifs_info *c)
/* If recovery is not required, then the orphans from the previous session are not needed. This function locates the LEBs used to record orphans, and un-maps them.  */
int ubifs_clear_orphans(struct ubifs_info *c)
{
	int lnum, err;
	for (lnum = c->orph_first; lnum <= c->orph_last; lnum++) {
		err = ubifs_leb_unmap(c, lnum);
		if (err)
			return err;
	}
	c->ohead_lnum = c->orph_first;
	c->ohead_offs = 0;
	return 0;
}