Lines Matching refs:aeb
150 struct ubi_ainf_peb *aeb; in add_aeb() local
152 aeb = kmem_cache_alloc(ai->aeb_slab_cache, GFP_KERNEL); in add_aeb()
153 if (!aeb) in add_aeb()
156 aeb->pnum = pnum; in add_aeb()
157 aeb->ec = ec; in add_aeb()
158 aeb->lnum = -1; in add_aeb()
159 aeb->scrub = scrub; in add_aeb()
160 aeb->copy_flag = aeb->sqnum = 0; in add_aeb()
162 ai->ec_sum += aeb->ec; in add_aeb()
165 if (ai->max_ec < aeb->ec) in add_aeb()
166 ai->max_ec = aeb->ec; in add_aeb()
168 if (ai->min_ec > aeb->ec) in add_aeb()
169 ai->min_ec = aeb->ec; in add_aeb()
171 list_add_tail(&aeb->u.list, list); in add_aeb()
238 struct ubi_ainf_peb *aeb, in assign_aeb_to_av() argument
249 if (aeb->lnum != tmp_aeb->lnum) { in assign_aeb_to_av()
250 if (aeb->lnum < tmp_aeb->lnum) in assign_aeb_to_av()
260 list_del(&aeb->u.list); in assign_aeb_to_av()
263 rb_link_node(&aeb->u.rb, parent, p); in assign_aeb_to_av()
264 rb_insert_color(&aeb->u.rb, &av->root); in assign_aeb_to_av()
282 struct ubi_ainf_peb *aeb, *victim; in update_vol() local
287 aeb = rb_entry(parent, struct ubi_ainf_peb, u.rb); in update_vol()
289 if (be32_to_cpu(new_vh->lnum) != aeb->lnum) { in update_vol()
290 if (be32_to_cpu(new_vh->lnum) < aeb->lnum) in update_vol()
302 if (aeb->pnum == new_aeb->pnum) { in update_vol()
303 ubi_assert(aeb->lnum == new_aeb->lnum); in update_vol()
309 cmp_res = ubi_compare_lebs(ubi, aeb, new_aeb->pnum, new_vh); in update_vol()
320 victim->ec = aeb->ec; in update_vol()
321 victim->pnum = aeb->pnum; in update_vol()
329 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
331 aeb->ec = new_aeb->ec; in update_vol()
332 aeb->pnum = new_aeb->pnum; in update_vol()
333 aeb->copy_flag = new_vh->copy_flag; in update_vol()
334 aeb->scrub = new_aeb->scrub; in update_vol()
340 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
428 struct ubi_ainf_peb *aeb; in unmap_peb() local
435 aeb = rb_entry(node2, struct ubi_ainf_peb, u.rb); in unmap_peb()
436 if (aeb->pnum == pnum) { in unmap_peb()
437 rb_erase(&aeb->u.rb, &av->root); in unmap_peb()
439 kmem_cache_free(ai->aeb_slab_cache, aeb); in unmap_peb()
582 struct ubi_ainf_peb *aeb; in count_fastmap_pebs() local
587 list_for_each_entry(aeb, &ai->erase, u.list) in count_fastmap_pebs()
590 list_for_each_entry(aeb, &ai->free, u.list) in count_fastmap_pebs()
594 ubi_rb_for_each_entry(rb2, aeb, &av->root, u.rb) in count_fastmap_pebs()
615 struct ubi_ainf_peb *aeb, *tmp_aeb, *_tmp_aeb; in ubi_attach_fastmap() local
793 aeb = NULL; in ubi_attach_fastmap()
796 aeb = tmp_aeb; in ubi_attach_fastmap()
801 if (!aeb) { in ubi_attach_fastmap()
806 aeb->lnum = j; in ubi_attach_fastmap()
808 if (av->highest_lnum <= aeb->lnum) in ubi_attach_fastmap()
809 av->highest_lnum = aeb->lnum; in ubi_attach_fastmap()
811 assign_aeb_to_av(ai, aeb, av); in ubi_attach_fastmap()
814 aeb->pnum, aeb->lnum, av->vol_id); in ubi_attach_fastmap()