Lines Matching refs:aeb
145 struct ubi_ainf_peb *aeb; in add_aeb() local
147 aeb = kmem_cache_alloc(ai->aeb_slab_cache, GFP_KERNEL); in add_aeb()
148 if (!aeb) in add_aeb()
151 aeb->pnum = pnum; in add_aeb()
152 aeb->ec = ec; in add_aeb()
153 aeb->lnum = -1; in add_aeb()
154 aeb->scrub = scrub; in add_aeb()
155 aeb->copy_flag = aeb->sqnum = 0; in add_aeb()
157 ai->ec_sum += aeb->ec; in add_aeb()
160 if (ai->max_ec < aeb->ec) in add_aeb()
161 ai->max_ec = aeb->ec; in add_aeb()
163 if (ai->min_ec > aeb->ec) in add_aeb()
164 ai->min_ec = aeb->ec; in add_aeb()
166 list_add_tail(&aeb->u.list, list); in add_aeb()
233 struct ubi_ainf_peb *aeb, in assign_aeb_to_av() argument
244 if (aeb->lnum != tmp_aeb->lnum) { in assign_aeb_to_av()
245 if (aeb->lnum < tmp_aeb->lnum) in assign_aeb_to_av()
255 list_del(&aeb->u.list); in assign_aeb_to_av()
258 rb_link_node(&aeb->u.rb, parent, p); in assign_aeb_to_av()
259 rb_insert_color(&aeb->u.rb, &av->root); in assign_aeb_to_av()
277 struct ubi_ainf_peb *aeb, *victim; in update_vol() local
282 aeb = rb_entry(parent, struct ubi_ainf_peb, u.rb); in update_vol()
284 if (be32_to_cpu(new_vh->lnum) != aeb->lnum) { in update_vol()
285 if (be32_to_cpu(new_vh->lnum) < aeb->lnum) in update_vol()
297 if (aeb->pnum == new_aeb->pnum) { in update_vol()
298 ubi_assert(aeb->lnum == new_aeb->lnum); in update_vol()
304 cmp_res = ubi_compare_lebs(ubi, aeb, new_aeb->pnum, new_vh); in update_vol()
315 victim->ec = aeb->ec; in update_vol()
316 victim->pnum = aeb->pnum; in update_vol()
324 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
326 aeb->ec = new_aeb->ec; in update_vol()
327 aeb->pnum = new_aeb->pnum; in update_vol()
328 aeb->copy_flag = new_vh->copy_flag; in update_vol()
329 aeb->scrub = new_aeb->scrub; in update_vol()
335 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
423 struct ubi_ainf_peb *aeb; in unmap_peb() local
430 aeb = rb_entry(node2, struct ubi_ainf_peb, u.rb); in unmap_peb()
431 if (aeb->pnum == pnum) { in unmap_peb()
432 rb_erase(&aeb->u.rb, &av->root); in unmap_peb()
434 kmem_cache_free(ai->aeb_slab_cache, aeb); in unmap_peb()
577 struct ubi_ainf_peb *aeb; in count_fastmap_pebs() local
582 list_for_each_entry(aeb, &ai->erase, u.list) in count_fastmap_pebs()
585 list_for_each_entry(aeb, &ai->free, u.list) in count_fastmap_pebs()
589 ubi_rb_for_each_entry(rb2, aeb, &av->root, u.rb) in count_fastmap_pebs()
610 struct ubi_ainf_peb *aeb, *tmp_aeb, *_tmp_aeb; in ubi_attach_fastmap() local
788 aeb = NULL; in ubi_attach_fastmap()
791 aeb = tmp_aeb; in ubi_attach_fastmap()
796 if (!aeb) { in ubi_attach_fastmap()
801 aeb->lnum = j; in ubi_attach_fastmap()
803 if (av->highest_lnum <= aeb->lnum) in ubi_attach_fastmap()
804 av->highest_lnum = aeb->lnum; in ubi_attach_fastmap()
806 assign_aeb_to_av(ai, aeb, av); in ubi_attach_fastmap()
809 aeb->pnum, aeb->lnum, av->vol_id); in ubi_attach_fastmap()