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
165 e = wl_get_wle(ubi); in ubi_refill_pools()
166 if (!e) in ubi_refill_pools()
169 pool->pebs[pool->size] = e->pnum; in ubi_refill_pools()
178 e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF); in ubi_refill_pools()
179 self_check_in_wl_tree(ubi, e, &ubi->free); in ubi_refill_pools()
180 rb_erase(&e->u.rb, &ubi->free); in ubi_refill_pools()
183 wl_pool->pebs[wl_pool->size] = e->pnum; in ubi_refill_pools()
309 struct ubi_wl_entry *e; in need_wear_leveling() local
314 e = next_peb_for_wl(ubi); in need_wear_leveling()
315 if (!e) { in need_wear_leveling()
318 e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF); in need_wear_leveling()
319 ec = e->ec; in need_wear_leveling()
321 ec = e->ec; in need_wear_leveling()
323 e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF); in need_wear_leveling()
324 ec = max(ec, e->ec); in need_wear_leveling()
327 e = rb_entry(rb_first(&ubi->used), struct ubi_wl_entry, u.rb); in need_wear_leveling()
329 return ec - e->ec >= UBI_WL_THRESHOLD; in need_wear_leveling()
418 struct ubi_wl_entry *e; in ubi_wl_put_fm_peb() local
427 e = ubi->lookuptbl[pnum]; in ubi_wl_put_fm_peb()
433 if (!e) { in ubi_wl_put_fm_peb()
434 e = fm_e; in ubi_wl_put_fm_peb()
435 ubi_assert(e->ec >= 0); in ubi_wl_put_fm_peb()
436 ubi->lookuptbl[pnum] = e; in ubi_wl_put_fm_peb()
442 return schedule_erase(ubi, e, vol_id, lnum, torture, true); in ubi_wl_put_fm_peb()
468 kfree(ubi->fm->e[i]); in ubi_fastmap_close()
482 struct ubi_wl_entry *e, in may_reserve_for_fm() argument
484 if (e && !ubi->fm_disabled && !ubi->fm && in may_reserve_for_fm()
485 e->pnum < UBI_FM_MAX_START) in may_reserve_for_fm()
486 e = rb_entry(rb_next(root->rb_node), in may_reserve_for_fm()
489 return e; in may_reserve_for_fm()