Lines Matching refs:lp

469 int ubifs_garbage_collect_leb(struct ubifs_info *c, struct ubifs_lprops *lp)  in ubifs_garbage_collect_leb()  argument
474 int err = 0, lnum = lp->lnum; in ubifs_garbage_collect_leb()
481 if (lp->free + lp->dirty == c->leb_size) { in ubifs_garbage_collect_leb()
483 dbg_gc("LEB %d is free, return it", lp->lnum); in ubifs_garbage_collect_leb()
484 ubifs_assert(!(lp->flags & LPROPS_INDEX)); in ubifs_garbage_collect_leb()
486 if (lp->free != c->leb_size) { in ubifs_garbage_collect_leb()
495 err = ubifs_change_one_lp(c, lp->lnum, c->leb_size, in ubifs_garbage_collect_leb()
500 err = ubifs_leb_unmap(c, lp->lnum); in ubifs_garbage_collect_leb()
527 lnum, lp->free, lp->dirty); in ubifs_garbage_collect_leb()
563 lnum, lp->free, lp->dirty); in ubifs_garbage_collect_leb()
651 struct ubifs_lprops lp; in ubifs_garbage_collect() local
709 ret = ubifs_find_dirty_leb(c, &lp, min_space, anyway ? 0 : 1); in ubifs_garbage_collect()
717 lp.lnum, lp.free, lp.dirty, lp.free + lp.dirty, in ubifs_garbage_collect()
724 ret = ubifs_garbage_collect_leb(c, &lp); in ubifs_garbage_collect()
733 err = ubifs_return_leb(c, lp.lnum); in ubifs_garbage_collect()
743 dbg_gc("LEB %d freed, return", lp.lnum); in ubifs_garbage_collect()
744 ret = lp.lnum; in ubifs_garbage_collect()
755 dbg_gc("indexing LEB %d freed, continue", lp.lnum); in ubifs_garbage_collect()
761 dbg_gc("LEB %d retained, freed %d bytes", lp.lnum, in ubifs_garbage_collect()
824 ubifs_return_leb(c, lp.lnum); in ubifs_garbage_collect()
842 const struct ubifs_lprops *lp; in ubifs_gc_start_commit() local
852 lp = ubifs_fast_find_freeable(c); in ubifs_gc_start_commit()
853 if (IS_ERR(lp)) { in ubifs_gc_start_commit()
854 err = PTR_ERR(lp); in ubifs_gc_start_commit()
857 if (!lp) in ubifs_gc_start_commit()
859 ubifs_assert(!(lp->flags & LPROPS_TAKEN)); in ubifs_gc_start_commit()
860 ubifs_assert(!(lp->flags & LPROPS_INDEX)); in ubifs_gc_start_commit()
861 err = ubifs_leb_unmap(c, lp->lnum); in ubifs_gc_start_commit()
864 lp = ubifs_change_lp(c, lp, c->leb_size, 0, lp->flags, 0); in ubifs_gc_start_commit()
865 if (IS_ERR(lp)) { in ubifs_gc_start_commit()
866 err = PTR_ERR(lp); in ubifs_gc_start_commit()
869 ubifs_assert(!(lp->flags & LPROPS_TAKEN)); in ubifs_gc_start_commit()
870 ubifs_assert(!(lp->flags & LPROPS_INDEX)); in ubifs_gc_start_commit()
879 lp = ubifs_fast_find_frdi_idx(c); in ubifs_gc_start_commit()
880 if (IS_ERR(lp)) { in ubifs_gc_start_commit()
881 err = PTR_ERR(lp); in ubifs_gc_start_commit()
884 if (!lp) in ubifs_gc_start_commit()
891 ubifs_assert(!(lp->flags & LPROPS_TAKEN)); in ubifs_gc_start_commit()
892 ubifs_assert(lp->flags & LPROPS_INDEX); in ubifs_gc_start_commit()
894 flags = (lp->flags | LPROPS_TAKEN) ^ LPROPS_INDEX; in ubifs_gc_start_commit()
895 lp = ubifs_change_lp(c, lp, c->leb_size, 0, flags, 1); in ubifs_gc_start_commit()
896 if (IS_ERR(lp)) { in ubifs_gc_start_commit()
897 err = PTR_ERR(lp); in ubifs_gc_start_commit()
901 ubifs_assert(lp->flags & LPROPS_TAKEN); in ubifs_gc_start_commit()
902 ubifs_assert(!(lp->flags & LPROPS_INDEX)); in ubifs_gc_start_commit()
903 idx_gc->lnum = lp->lnum; in ubifs_gc_start_commit()