Lines Matching refs:lp

237 	const struct ubifs_lprops *lp = NULL, *idx_lp = NULL;  in ubifs_find_dirty_leb()  local
264 lp = ubifs_fast_find_empty(c); in ubifs_find_dirty_leb()
265 if (lp) in ubifs_find_dirty_leb()
269 lp = ubifs_fast_find_freeable(c); in ubifs_find_dirty_leb()
270 if (lp) in ubifs_find_dirty_leb()
305 lp = heap->arr[0]; in ubifs_find_dirty_leb()
306 if (lp->dirty + lp->free < min_space) in ubifs_find_dirty_leb()
307 lp = NULL; in ubifs_find_dirty_leb()
311 if (idx_lp && lp) { in ubifs_find_dirty_leb()
312 if (idx_lp->free + idx_lp->dirty >= lp->free + lp->dirty) in ubifs_find_dirty_leb()
313 lp = idx_lp; in ubifs_find_dirty_leb()
314 } else if (idx_lp && !lp) in ubifs_find_dirty_leb()
315 lp = idx_lp; in ubifs_find_dirty_leb()
317 if (lp) { in ubifs_find_dirty_leb()
318 ubifs_assert(lp->free + lp->dirty >= c->dead_wm); in ubifs_find_dirty_leb()
324 lp = scan_for_dirty(c, min_space, pick_free, exclude_index); in ubifs_find_dirty_leb()
325 if (IS_ERR(lp)) { in ubifs_find_dirty_leb()
326 err = PTR_ERR(lp); in ubifs_find_dirty_leb()
329 ubifs_assert(lp->dirty >= c->dead_wm || in ubifs_find_dirty_leb()
330 (pick_free && lp->free + lp->dirty == c->leb_size)); in ubifs_find_dirty_leb()
334 lp->lnum, lp->free, lp->dirty, lp->flags); in ubifs_find_dirty_leb()
336 lp = ubifs_change_lp(c, lp, LPROPS_NC, LPROPS_NC, in ubifs_find_dirty_leb()
337 lp->flags | LPROPS_TAKEN, 0); in ubifs_find_dirty_leb()
338 if (IS_ERR(lp)) { in ubifs_find_dirty_leb()
339 err = PTR_ERR(lp); in ubifs_find_dirty_leb()
343 memcpy(ret_lp, lp, sizeof(struct ubifs_lprops)); in ubifs_find_dirty_leb()
900 const struct ubifs_lprops *lp; in get_idx_gc_leb() local
911 lp = ubifs_lpt_lookup_dirty(c, lnum); in get_idx_gc_leb()
912 if (IS_ERR(lp)) in get_idx_gc_leb()
913 return PTR_ERR(lp); in get_idx_gc_leb()
914 lp = ubifs_change_lp(c, lp, LPROPS_NC, LPROPS_NC, in get_idx_gc_leb()
915 lp->flags | LPROPS_INDEX, -1); in get_idx_gc_leb()
916 if (IS_ERR(lp)) in get_idx_gc_leb()
917 return PTR_ERR(lp); in get_idx_gc_leb()
919 lp->lnum, lp->dirty, lp->free, lp->flags); in get_idx_gc_leb()
929 const struct ubifs_lprops *lp; in find_dirtiest_idx_leb() local
937 lp = ubifs_lpt_lookup(c, lnum); in find_dirtiest_idx_leb()
938 if (IS_ERR(lp)) in find_dirtiest_idx_leb()
939 return PTR_ERR(lp); in find_dirtiest_idx_leb()
940 if ((lp->flags & LPROPS_TAKEN) || !(lp->flags & LPROPS_INDEX)) in find_dirtiest_idx_leb()
942 lp = ubifs_change_lp(c, lp, LPROPS_NC, LPROPS_NC, in find_dirtiest_idx_leb()
943 lp->flags | LPROPS_TAKEN, 0); in find_dirtiest_idx_leb()
944 if (IS_ERR(lp)) in find_dirtiest_idx_leb()
945 return PTR_ERR(lp); in find_dirtiest_idx_leb()
948 dbg_find("LEB %d, dirty %d and free %d flags %#x", lp->lnum, lp->dirty, in find_dirtiest_idx_leb()
949 lp->free, lp->flags); in find_dirtiest_idx_leb()
950 ubifs_assert(lp->flags & LPROPS_TAKEN); in find_dirtiest_idx_leb()
951 ubifs_assert(lp->flags & LPROPS_INDEX); in find_dirtiest_idx_leb()