Lines Matching refs:aeb
138 struct ubi_ainf_peb *aeb; in add_aeb() local
140 aeb = ubi_alloc_aeb(ai, pnum, ec); in add_aeb()
141 if (!aeb) in add_aeb()
144 aeb->lnum = -1; in add_aeb()
145 aeb->scrub = scrub; in add_aeb()
146 aeb->copy_flag = aeb->sqnum = 0; in add_aeb()
148 ai->ec_sum += aeb->ec; in add_aeb()
151 if (ai->max_ec < aeb->ec) in add_aeb()
152 ai->max_ec = aeb->ec; in add_aeb()
154 if (ai->min_ec > aeb->ec) in add_aeb()
155 ai->min_ec = aeb->ec; in add_aeb()
157 list_add_tail(&aeb->u.list, list); in add_aeb()
203 struct ubi_ainf_peb *aeb, in assign_aeb_to_av() argument
213 if (aeb->lnum != tmp_aeb->lnum) { in assign_aeb_to_av()
214 if (aeb->lnum < tmp_aeb->lnum) in assign_aeb_to_av()
224 list_del(&aeb->u.list); in assign_aeb_to_av()
227 rb_link_node(&aeb->u.rb, parent, p); in assign_aeb_to_av()
228 rb_insert_color(&aeb->u.rb, &av->root); in assign_aeb_to_av()
246 struct ubi_ainf_peb *aeb, *victim; in update_vol() local
251 aeb = rb_entry(parent, struct ubi_ainf_peb, u.rb); in update_vol()
253 if (be32_to_cpu(new_vh->lnum) != aeb->lnum) { in update_vol()
254 if (be32_to_cpu(new_vh->lnum) < aeb->lnum) in update_vol()
266 if (aeb->pnum == new_aeb->pnum) { in update_vol()
267 ubi_assert(aeb->lnum == new_aeb->lnum); in update_vol()
273 cmp_res = ubi_compare_lebs(ubi, aeb, new_aeb->pnum, new_vh); in update_vol()
279 victim = ubi_alloc_aeb(ai, aeb->pnum, aeb->ec); in update_vol()
290 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
292 aeb->ec = new_aeb->ec; in update_vol()
293 aeb->pnum = new_aeb->pnum; in update_vol()
294 aeb->copy_flag = new_vh->copy_flag; in update_vol()
295 aeb->scrub = new_aeb->scrub; in update_vol()
296 aeb->sqnum = new_aeb->sqnum; in update_vol()
302 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
373 struct ubi_ainf_peb *aeb; in unmap_peb() local
376 ubi_rb_for_each_entry(node2, aeb, &av->root, u.rb) { in unmap_peb()
377 if (aeb->pnum == pnum) { in unmap_peb()
378 rb_erase(&aeb->u.rb, &av->root); in unmap_peb()
380 ubi_free_aeb(ai, aeb); in unmap_peb()
520 struct ubi_ainf_peb *aeb; in count_fastmap_pebs() local
525 list_for_each_entry(aeb, &ai->erase, u.list) in count_fastmap_pebs()
528 list_for_each_entry(aeb, &ai->free, u.list) in count_fastmap_pebs()
532 ubi_rb_for_each_entry(rb2, aeb, &av->root, u.rb) in count_fastmap_pebs()
553 struct ubi_ainf_peb *aeb, *tmp_aeb, *_tmp_aeb; in ubi_attach_fastmap() local
739 aeb = NULL; in ubi_attach_fastmap()
742 aeb = tmp_aeb; in ubi_attach_fastmap()
747 if (!aeb) { in ubi_attach_fastmap()
752 aeb->lnum = j; in ubi_attach_fastmap()
754 if (av->highest_lnum <= aeb->lnum) in ubi_attach_fastmap()
755 av->highest_lnum = aeb->lnum; in ubi_attach_fastmap()
757 assign_aeb_to_av(ai, aeb, av); in ubi_attach_fastmap()
760 aeb->pnum, aeb->lnum, av->vol_id); in ubi_attach_fastmap()
817 struct ubi_ainf_peb *aeb; in find_fm_anchor() local
820 list_for_each_entry(aeb, &ai->fastmap, u.list) { in find_fm_anchor()
821 if (aeb->vol_id == UBI_FM_SB_VOLUME_ID && aeb->sqnum > max_sqnum) { in find_fm_anchor()
822 max_sqnum = aeb->sqnum; in find_fm_anchor()
823 ret = aeb->pnum; in find_fm_anchor()
867 struct ubi_ainf_peb *aeb; in ubi_scan_fastmap() local
878 list_for_each_entry(aeb, &scan_ai->fastmap, u.list) { in ubi_scan_fastmap()
881 new = clone_aeb(ai, aeb); in ubi_scan_fastmap()