/* This function changes properties of LEB @lnum. It is a helper wrapper over 'ubifs_change_lp()' which hides lprops get/release. The arguments are the same as in case of 'ubifs_change_lp()'. Returns zero in case of success and a negative error code in case of failure.  */
int ubifs_change_one_lp(struct ubifs_info *c, int lnum, int free, int dirty, int flags_set, int flags_clean, int idx_gc_cnt)
/* This function changes properties of LEB @lnum. It is a helper wrapper over 'ubifs_change_lp()' which hides lprops get/release. The arguments are the same as in case of 'ubifs_change_lp()'. Returns zero in case of success and a negative error code in case of failure.  */
int ubifs_change_one_lp(struct ubifs_info *c, int lnum, int free, int dirty, int flags_set, int flags_clean, int idx_gc_cnt)
{
	int err = 0, flags;
	const struct ubifs_lprops *lp;
	ubifs_get_lprops(c);
	lp = ubifs_lpt_lookup_dirty(c, lnum);
	if (IS_ERR(lp)) {
		err = PTR_ERR(lp);
		goto out;
	}
	flags = (lp->flags | flags_set) & ~flags_clean;
	lp = ubifs_change_lp(c, lp, free, dirty, flags, idx_gc_cnt);
	if (IS_ERR(lp))
		err = PTR_ERR(lp);
out:
	ubifs_release_lprops(c);
	if (err)
		ubifs_err("cannot change properties of LEB %d, error %d",
			  lnum, err);
	return err;
}