/* leb_read_unlock - unlock logical eraseblock. @ubi: UBI device description object @vol_id: volume ID @lnum: logical eraseblock number  */
static void leb_read_unlock(struct ubi_device *ubi, int vol_id, int lnum)
/* leb_read_unlock - unlock logical eraseblock. @ubi: UBI device description object @vol_id: volume ID @lnum: logical eraseblock number  */
static void leb_read_unlock(struct ubi_device *ubi, int vol_id, int lnum)
{
	struct ubi_ltree_entry *le;
	spin_lock(&ubi->ltree_lock);
	le = ltree_lookup(ubi, vol_id, lnum);
	le->users -= 1;
	ubi_assert(le->users >= 0);
	up_read(&le->mutex);
	if (le->users == 0) {
		rb_erase(&le->rb, &ubi->ltree);
		kfree(le);
	}
	spin_unlock(&ubi->ltree_lock);
}