Lines Matching refs:aeb
139 struct ubi_ainf_peb *aeb; in add_aeb() local
141 aeb = ubi_alloc_aeb(ai, pnum, ec); in add_aeb()
142 if (!aeb) in add_aeb()
145 aeb->lnum = -1; in add_aeb()
146 aeb->scrub = scrub; in add_aeb()
147 aeb->copy_flag = aeb->sqnum = 0; in add_aeb()
149 ai->ec_sum += aeb->ec; in add_aeb()
152 if (ai->max_ec < aeb->ec) in add_aeb()
153 ai->max_ec = aeb->ec; in add_aeb()
155 if (ai->min_ec > aeb->ec) in add_aeb()
156 ai->min_ec = aeb->ec; in add_aeb()
158 list_add_tail(&aeb->u.list, list); in add_aeb()
204 struct ubi_ainf_peb *aeb, in assign_aeb_to_av() argument
214 if (aeb->lnum != tmp_aeb->lnum) { in assign_aeb_to_av()
215 if (aeb->lnum < tmp_aeb->lnum) in assign_aeb_to_av()
225 list_del(&aeb->u.list); in assign_aeb_to_av()
228 rb_link_node(&aeb->u.rb, parent, p); in assign_aeb_to_av()
229 rb_insert_color(&aeb->u.rb, &av->root); in assign_aeb_to_av()
247 struct ubi_ainf_peb *aeb, *victim; in update_vol() local
252 aeb = rb_entry(parent, struct ubi_ainf_peb, u.rb); in update_vol()
254 if (be32_to_cpu(new_vh->lnum) != aeb->lnum) { in update_vol()
255 if (be32_to_cpu(new_vh->lnum) < aeb->lnum) in update_vol()
267 if (aeb->pnum == new_aeb->pnum) { in update_vol()
268 ubi_assert(aeb->lnum == new_aeb->lnum); in update_vol()
274 cmp_res = ubi_compare_lebs(ubi, aeb, new_aeb->pnum, new_vh); in update_vol()
280 victim = ubi_alloc_aeb(ai, aeb->pnum, aeb->ec); in update_vol()
291 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
293 aeb->ec = new_aeb->ec; in update_vol()
294 aeb->pnum = new_aeb->pnum; in update_vol()
295 aeb->copy_flag = new_vh->copy_flag; in update_vol()
296 aeb->scrub = new_aeb->scrub; in update_vol()
297 aeb->sqnum = new_aeb->sqnum; in update_vol()
303 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
374 struct ubi_ainf_peb *aeb; in unmap_peb() local
377 ubi_rb_for_each_entry(node2, aeb, &av->root, u.rb) { in unmap_peb()
378 if (aeb->pnum == pnum) { in unmap_peb()
379 rb_erase(&aeb->u.rb, &av->root); in unmap_peb()
381 ubi_free_aeb(ai, aeb); in unmap_peb()
521 struct ubi_ainf_peb *aeb; in count_fastmap_pebs() local
526 list_for_each_entry(aeb, &ai->erase, u.list) in count_fastmap_pebs()
529 list_for_each_entry(aeb, &ai->free, u.list) in count_fastmap_pebs()
533 ubi_rb_for_each_entry(rb2, aeb, &av->root, u.rb) in count_fastmap_pebs()
554 struct ubi_ainf_peb *aeb, *tmp_aeb, *_tmp_aeb; in ubi_attach_fastmap() local
740 aeb = NULL; in ubi_attach_fastmap()
743 aeb = tmp_aeb; in ubi_attach_fastmap()
748 if (!aeb) { in ubi_attach_fastmap()
753 aeb->lnum = j; in ubi_attach_fastmap()
755 if (av->highest_lnum <= aeb->lnum) in ubi_attach_fastmap()
756 av->highest_lnum = aeb->lnum; in ubi_attach_fastmap()
758 assign_aeb_to_av(ai, aeb, av); in ubi_attach_fastmap()
761 aeb->pnum, aeb->lnum, av->vol_id); in ubi_attach_fastmap()
818 struct ubi_ainf_peb *aeb; in find_fm_anchor() local
821 list_for_each_entry(aeb, &ai->fastmap, u.list) { in find_fm_anchor()
822 if (aeb->vol_id == UBI_FM_SB_VOLUME_ID && aeb->sqnum > max_sqnum) { in find_fm_anchor()
823 max_sqnum = aeb->sqnum; in find_fm_anchor()
824 ret = aeb->pnum; in find_fm_anchor()
868 struct ubi_ainf_peb *aeb; in ubi_scan_fastmap() local
879 list_for_each_entry(aeb, &scan_ai->fastmap, u.list) { in ubi_scan_fastmap()
882 new = clone_aeb(ai, aeb); in ubi_scan_fastmap()