/* During commit, the orphans being committed cannot be deleted, so they are marked for deletion and deleted by this function. Also, the recovery adds killed orphans to the deletion list, and therefore they are deleted here too.  */
static void erase_deleted(struct ubifs_info *c)
/* During commit, the orphans being committed cannot be deleted, so they are marked for deletion and deleted by this function. Also, the recovery adds killed orphans to the deletion list, and therefore they are deleted here too.  */
static void erase_deleted(struct ubifs_info *c)
{
	struct ubifs_orphan *orphan, *dnext;
	spin_lock(&c->orphan_lock);
	dnext = c->orph_dnext;
	while (dnext) {
		orphan = dnext;
		dnext = orphan->dnext;
		ubifs_assert(!orphan->new);
		rb_erase(&orphan->rb, &c->orph_tree);
		list_del(&orphan->list);
		c->tot_orphans -= 1;
		dbg_gen("deleting orphan ino %lu", (unsigned long)orphan->inum);
		kfree(orphan);
	}
	c->orph_dnext = NULL;
	spin_unlock(&c->orphan_lock);
}