Lines Matching refs:e

29 	struct ubi_wl_entry *e, *victim = NULL;  in find_anchor_wl_entry()  local
32 ubi_rb_for_each_entry(p, e, root, u.rb) { in find_anchor_wl_entry()
33 if (e->pnum < UBI_FM_MAX_START && e->ec < max_ec) { in find_anchor_wl_entry()
34 victim = e; in find_anchor_wl_entry()
35 max_ec = e->ec; in find_anchor_wl_entry()
43 struct ubi_wl_entry *e) in return_unused_peb() argument
45 wl_tree_add(e, &ubi->free); in return_unused_peb()
58 struct ubi_wl_entry *e; in return_unused_pool_pebs() local
61 e = ubi->lookuptbl[pool->pebs[i]]; in return_unused_pool_pebs()
62 return_unused_peb(ubi, e); in return_unused_pool_pebs()
77 struct ubi_wl_entry *e = NULL; in ubi_wl_get_fm_peb() local
83 e = find_anchor_wl_entry(&ubi->free); in ubi_wl_get_fm_peb()
85 e = find_mean_wl_entry(ubi, &ubi->free); in ubi_wl_get_fm_peb()
87 if (!e) in ubi_wl_get_fm_peb()
90 self_check_in_wl_tree(ubi, e, &ubi->free); in ubi_wl_get_fm_peb()
94 rb_erase(&e->u.rb, &ubi->free); in ubi_wl_get_fm_peb()
97 return e; in ubi_wl_get_fm_peb()
135 struct ubi_wl_entry *e; in ubi_refill_pools() local
163 e = wl_get_wle(ubi); in ubi_refill_pools()
164 if (!e) in ubi_refill_pools()
167 pool->pebs[pool->size] = e->pnum; in ubi_refill_pools()
176 e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF); in ubi_refill_pools()
177 self_check_in_wl_tree(ubi, e, &ubi->free); in ubi_refill_pools()
178 rb_erase(&e->u.rb, &ubi->free); in ubi_refill_pools()
181 wl_pool->pebs[wl_pool->size] = e->pnum; in ubi_refill_pools()
307 struct ubi_wl_entry *e; in need_wear_leveling() local
312 e = next_peb_for_wl(ubi); in need_wear_leveling()
313 if (!e) { in need_wear_leveling()
316 e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF); in need_wear_leveling()
317 ec = e->ec; in need_wear_leveling()
319 ec = e->ec; in need_wear_leveling()
321 e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF); in need_wear_leveling()
322 ec = max(ec, e->ec); in need_wear_leveling()
325 e = rb_entry(rb_first(&ubi->used), struct ubi_wl_entry, u.rb); in need_wear_leveling()
327 return ec - e->ec >= UBI_WL_THRESHOLD; in need_wear_leveling()
416 struct ubi_wl_entry *e; in ubi_wl_put_fm_peb() local
425 e = ubi->lookuptbl[pnum]; in ubi_wl_put_fm_peb()
431 if (!e) { in ubi_wl_put_fm_peb()
432 e = fm_e; in ubi_wl_put_fm_peb()
433 ubi_assert(e->ec >= 0); in ubi_wl_put_fm_peb()
434 ubi->lookuptbl[pnum] = e; in ubi_wl_put_fm_peb()
440 return schedule_erase(ubi, e, vol_id, lnum, torture, true); in ubi_wl_put_fm_peb()
466 kfree(ubi->fm->e[i]); in ubi_fastmap_close()
480 struct ubi_wl_entry *e, in may_reserve_for_fm() argument
482 if (e && !ubi->fm_disabled && !ubi->fm && in may_reserve_for_fm()
483 e->pnum < UBI_FM_MAX_START) in may_reserve_for_fm()
484 e = rb_entry(rb_next(root->rb_node), in may_reserve_for_fm()
487 return e; in may_reserve_for_fm()