/* LPT trivial GC is completed after a commit. Also LPT GC is done after a commit for the "big" LPT model.  */
int ubifs_lpt_post_commit(struct ubifs_info *c)
/* LPT trivial GC is completed after a commit. Also LPT GC is done after a commit for the "big" LPT model.  */
int ubifs_lpt_post_commit(struct ubifs_info *c)
{
	int err;
	mutex_lock(&c->lp_mutex);
	err = lpt_tgc_end(c);
	if (err)
		goto out;
	if (c->big_lpt)
		while (need_write_all(c)) {
			mutex_unlock(&c->lp_mutex);
			err = lpt_gc(c);
			if (err)
				return err;
			mutex_lock(&c->lp_mutex);
		}
out:
	mutex_unlock(&c->lp_mutex);
	return err;
}