Lines Matching refs:lp

460 int ubifs_garbage_collect_leb(struct ubifs_info *c, struct ubifs_lprops *lp)  in ubifs_garbage_collect_leb()  argument
465 int err = 0, lnum = lp->lnum; in ubifs_garbage_collect_leb()
472 if (lp->free + lp->dirty == c->leb_size) { in ubifs_garbage_collect_leb()
474 dbg_gc("LEB %d is free, return it", lp->lnum); in ubifs_garbage_collect_leb()
475 ubifs_assert(!(lp->flags & LPROPS_INDEX)); in ubifs_garbage_collect_leb()
477 if (lp->free != c->leb_size) { in ubifs_garbage_collect_leb()
486 err = ubifs_change_one_lp(c, lp->lnum, c->leb_size, in ubifs_garbage_collect_leb()
491 err = ubifs_leb_unmap(c, lp->lnum); in ubifs_garbage_collect_leb()
518 lnum, lp->free, lp->dirty); in ubifs_garbage_collect_leb()
554 lnum, lp->free, lp->dirty); in ubifs_garbage_collect_leb()
642 struct ubifs_lprops lp; in ubifs_garbage_collect() local
700 ret = ubifs_find_dirty_leb(c, &lp, min_space, anyway ? 0 : 1); in ubifs_garbage_collect()
708 lp.lnum, lp.free, lp.dirty, lp.free + lp.dirty, in ubifs_garbage_collect()
715 ret = ubifs_garbage_collect_leb(c, &lp); in ubifs_garbage_collect()
724 err = ubifs_return_leb(c, lp.lnum); in ubifs_garbage_collect()
734 dbg_gc("LEB %d freed, return", lp.lnum); in ubifs_garbage_collect()
735 ret = lp.lnum; in ubifs_garbage_collect()
746 dbg_gc("indexing LEB %d freed, continue", lp.lnum); in ubifs_garbage_collect()
752 dbg_gc("LEB %d retained, freed %d bytes", lp.lnum, in ubifs_garbage_collect()
815 ubifs_return_leb(c, lp.lnum); in ubifs_garbage_collect()
833 const struct ubifs_lprops *lp; in ubifs_gc_start_commit() local
843 lp = ubifs_fast_find_freeable(c); in ubifs_gc_start_commit()
844 if (IS_ERR(lp)) { in ubifs_gc_start_commit()
845 err = PTR_ERR(lp); in ubifs_gc_start_commit()
848 if (!lp) in ubifs_gc_start_commit()
850 ubifs_assert(!(lp->flags & LPROPS_TAKEN)); in ubifs_gc_start_commit()
851 ubifs_assert(!(lp->flags & LPROPS_INDEX)); in ubifs_gc_start_commit()
852 err = ubifs_leb_unmap(c, lp->lnum); in ubifs_gc_start_commit()
855 lp = ubifs_change_lp(c, lp, c->leb_size, 0, lp->flags, 0); in ubifs_gc_start_commit()
856 if (IS_ERR(lp)) { in ubifs_gc_start_commit()
857 err = PTR_ERR(lp); in ubifs_gc_start_commit()
860 ubifs_assert(!(lp->flags & LPROPS_TAKEN)); in ubifs_gc_start_commit()
861 ubifs_assert(!(lp->flags & LPROPS_INDEX)); in ubifs_gc_start_commit()
870 lp = ubifs_fast_find_frdi_idx(c); in ubifs_gc_start_commit()
871 if (IS_ERR(lp)) { in ubifs_gc_start_commit()
872 err = PTR_ERR(lp); in ubifs_gc_start_commit()
875 if (!lp) in ubifs_gc_start_commit()
882 ubifs_assert(!(lp->flags & LPROPS_TAKEN)); in ubifs_gc_start_commit()
883 ubifs_assert(lp->flags & LPROPS_INDEX); in ubifs_gc_start_commit()
885 flags = (lp->flags | LPROPS_TAKEN) ^ LPROPS_INDEX; in ubifs_gc_start_commit()
886 lp = ubifs_change_lp(c, lp, c->leb_size, 0, flags, 1); in ubifs_gc_start_commit()
887 if (IS_ERR(lp)) { in ubifs_gc_start_commit()
888 err = PTR_ERR(lp); in ubifs_gc_start_commit()
892 ubifs_assert(lp->flags & LPROPS_TAKEN); in ubifs_gc_start_commit()
893 ubifs_assert(!(lp->flags & LPROPS_INDEX)); in ubifs_gc_start_commit()
894 idx_gc->lnum = lp->lnum; in ubifs_gc_start_commit()