• Home
  • Raw
  • Download

Lines Matching refs:aeb

117 	struct ubi_ainf_peb *aeb;  in add_to_list()  local
129 aeb = kmem_cache_alloc(ai->aeb_slab_cache, GFP_KERNEL); in add_to_list()
130 if (!aeb) in add_to_list()
133 aeb->pnum = pnum; in add_to_list()
134 aeb->vol_id = vol_id; in add_to_list()
135 aeb->lnum = lnum; in add_to_list()
136 aeb->ec = ec; in add_to_list()
138 list_add(&aeb->u.list, list); in add_to_list()
140 list_add_tail(&aeb->u.list, list); in add_to_list()
157 struct ubi_ainf_peb *aeb; in add_corrupted() local
161 aeb = kmem_cache_alloc(ai->aeb_slab_cache, GFP_KERNEL); in add_corrupted()
162 if (!aeb) in add_corrupted()
166 aeb->pnum = pnum; in add_corrupted()
167 aeb->ec = ec; in add_corrupted()
168 list_add(&aeb->u.list, &ai->corr); in add_corrupted()
319 int ubi_compare_lebs(struct ubi_device *ubi, const struct ubi_ainf_peb *aeb, in ubi_compare_lebs() argument
327 if (sqnum2 == aeb->sqnum) { in ubi_compare_lebs()
341 second_is_newer = (sqnum2 > aeb->sqnum); in ubi_compare_lebs()
360 if (!aeb->copy_flag) { in ubi_compare_lebs()
371 pnum = aeb->pnum; in ubi_compare_lebs()
450 struct ubi_ainf_peb *aeb; in ubi_add_to_av() local
476 aeb = rb_entry(parent, struct ubi_ainf_peb, u.rb); in ubi_add_to_av()
477 if (lnum != aeb->lnum) { in ubi_add_to_av()
478 if (lnum < aeb->lnum) in ubi_add_to_av()
491 aeb->pnum, aeb->sqnum, aeb->ec); in ubi_add_to_av()
506 if (aeb->sqnum == sqnum && sqnum != 0) { in ubi_add_to_av()
509 ubi_dump_aeb(aeb, 0); in ubi_add_to_av()
518 cmp_res = ubi_compare_lebs(ubi, aeb, pnum, vid_hdr); in ubi_add_to_av()
531 err = add_to_list(ai, aeb->pnum, aeb->vol_id, in ubi_add_to_av()
532 aeb->lnum, aeb->ec, cmp_res & 4, in ubi_add_to_av()
537 aeb->ec = ec; in ubi_add_to_av()
538 aeb->pnum = pnum; in ubi_add_to_av()
539 aeb->vol_id = vol_id; in ubi_add_to_av()
540 aeb->lnum = lnum; in ubi_add_to_av()
541 aeb->scrub = ((cmp_res & 2) || bitflips); in ubi_add_to_av()
542 aeb->copy_flag = vid_hdr->copy_flag; in ubi_add_to_av()
543 aeb->sqnum = sqnum; in ubi_add_to_av()
569 aeb = kmem_cache_alloc(ai->aeb_slab_cache, GFP_KERNEL); in ubi_add_to_av()
570 if (!aeb) in ubi_add_to_av()
573 aeb->ec = ec; in ubi_add_to_av()
574 aeb->pnum = pnum; in ubi_add_to_av()
575 aeb->vol_id = vol_id; in ubi_add_to_av()
576 aeb->lnum = lnum; in ubi_add_to_av()
577 aeb->scrub = bitflips; in ubi_add_to_av()
578 aeb->copy_flag = vid_hdr->copy_flag; in ubi_add_to_av()
579 aeb->sqnum = sqnum; in ubi_add_to_av()
587 rb_link_node(&aeb->u.rb, parent, p); in ubi_add_to_av()
588 rb_insert_color(&aeb->u.rb, &av->root); in ubi_add_to_av()
629 struct ubi_ainf_peb *aeb; in ubi_remove_av() local
634 aeb = rb_entry(rb, struct ubi_ainf_peb, u.rb); in ubi_remove_av()
635 rb_erase(&aeb->u.rb, &av->root); in ubi_remove_av()
636 list_add_tail(&aeb->u.list, &ai->erase); in ubi_remove_av()
708 struct ubi_ainf_peb *aeb, *tmp_aeb; in ubi_early_get_peb() local
711 aeb = list_entry(ai->free.next, struct ubi_ainf_peb, u.list); in ubi_early_get_peb()
712 list_del(&aeb->u.list); in ubi_early_get_peb()
713 dbg_bld("return free PEB %d, EC %d", aeb->pnum, aeb->ec); in ubi_early_get_peb()
714 return aeb; in ubi_early_get_peb()
723 list_for_each_entry_safe(aeb, tmp_aeb, &ai->erase, u.list) { in ubi_early_get_peb()
724 if (aeb->ec == UBI_UNKNOWN) in ubi_early_get_peb()
725 aeb->ec = ai->mean_ec; in ubi_early_get_peb()
727 err = early_erase_peb(ubi, ai, aeb->pnum, aeb->ec+1); in ubi_early_get_peb()
731 aeb->ec += 1; in ubi_early_get_peb()
732 list_del(&aeb->u.list); in ubi_early_get_peb()
733 dbg_bld("return PEB %d, EC %d", aeb->pnum, aeb->ec); in ubi_early_get_peb()
734 return aeb; in ubi_early_get_peb()
1065 struct ubi_ainf_peb *aeb; in late_analysis() local
1080 list_for_each_entry(aeb, &ai->corr, u.list) in late_analysis()
1081 pr_cont(" %d", aeb->pnum); in late_analysis()
1134 struct ubi_ainf_peb *aeb; in destroy_av() local
1143 aeb = rb_entry(this, struct ubi_ainf_peb, u.rb); in destroy_av()
1146 if (this->rb_left == &aeb->u.rb) in destroy_av()
1152 kmem_cache_free(ai->aeb_slab_cache, aeb); in destroy_av()
1164 struct ubi_ainf_peb *aeb, *aeb_tmp; in destroy_ai() local
1168 list_for_each_entry_safe(aeb, aeb_tmp, &ai->alien, u.list) { in destroy_ai()
1169 list_del(&aeb->u.list); in destroy_ai()
1170 kmem_cache_free(ai->aeb_slab_cache, aeb); in destroy_ai()
1172 list_for_each_entry_safe(aeb, aeb_tmp, &ai->erase, u.list) { in destroy_ai()
1173 list_del(&aeb->u.list); in destroy_ai()
1174 kmem_cache_free(ai->aeb_slab_cache, aeb); in destroy_ai()
1176 list_for_each_entry_safe(aeb, aeb_tmp, &ai->corr, u.list) { in destroy_ai()
1177 list_del(&aeb->u.list); in destroy_ai()
1178 kmem_cache_free(ai->aeb_slab_cache, aeb); in destroy_ai()
1180 list_for_each_entry_safe(aeb, aeb_tmp, &ai->free, u.list) { in destroy_ai()
1181 list_del(&aeb->u.list); in destroy_ai()
1182 kmem_cache_free(ai->aeb_slab_cache, aeb); in destroy_ai()
1228 struct ubi_ainf_peb *aeb; in scan_all() local
1264 ubi_rb_for_each_entry(rb2, aeb, &av->root, u.rb) in scan_all()
1265 if (aeb->ec == UBI_UNKNOWN) in scan_all()
1266 aeb->ec = ai->mean_ec; in scan_all()
1269 list_for_each_entry(aeb, &ai->free, u.list) { in scan_all()
1270 if (aeb->ec == UBI_UNKNOWN) in scan_all()
1271 aeb->ec = ai->mean_ec; in scan_all()
1274 list_for_each_entry(aeb, &ai->corr, u.list) in scan_all()
1275 if (aeb->ec == UBI_UNKNOWN) in scan_all()
1276 aeb->ec = ai->mean_ec; in scan_all()
1278 list_for_each_entry(aeb, &ai->erase, u.list) in scan_all()
1279 if (aeb->ec == UBI_UNKNOWN) in scan_all()
1280 aeb->ec = ai->mean_ec; in scan_all()
1504 struct ubi_ainf_peb *aeb, *last_aeb; in self_check_ai() local
1556 ubi_rb_for_each_entry(rb2, aeb, &av->root, u.rb) { in self_check_ai()
1559 last_aeb = aeb; in self_check_ai()
1562 if (aeb->pnum < 0 || aeb->ec < 0) { in self_check_ai()
1567 if (aeb->ec < ai->min_ec) { in self_check_ai()
1569 ai->min_ec, aeb->ec); in self_check_ai()
1573 if (aeb->ec > ai->max_ec) { in self_check_ai()
1575 ai->max_ec, aeb->ec); in self_check_ai()
1579 if (aeb->pnum >= ubi->peb_count) { in self_check_ai()
1581 aeb->pnum, ubi->peb_count); in self_check_ai()
1586 if (aeb->lnum >= av->used_ebs) { in self_check_ai()
1597 if (aeb->lnum > av->highest_lnum) { in self_check_ai()
1612 aeb = last_aeb; in self_check_ai()
1614 if (aeb->lnum != av->highest_lnum) { in self_check_ai()
1629 ubi_rb_for_each_entry(rb2, aeb, &av->root, u.rb) { in self_check_ai()
1634 last_aeb = aeb; in self_check_ai()
1636 err = ubi_io_read_vid_hdr(ubi, aeb->pnum, vidh, 1); in self_check_ai()
1652 if (aeb->sqnum != be64_to_cpu(vidh->sqnum)) { in self_check_ai()
1653 ubi_err(ubi, "bad sqnum %llu", aeb->sqnum); in self_check_ai()
1667 if (aeb->lnum != be32_to_cpu(vidh->lnum)) { in self_check_ai()
1668 ubi_err(ubi, "bad lnum %d", aeb->lnum); in self_check_ai()
1716 ubi_rb_for_each_entry(rb2, aeb, &av->root, u.rb) in self_check_ai()
1717 buf[aeb->pnum] = 1; in self_check_ai()
1719 list_for_each_entry(aeb, &ai->free, u.list) in self_check_ai()
1720 buf[aeb->pnum] = 1; in self_check_ai()
1722 list_for_each_entry(aeb, &ai->corr, u.list) in self_check_ai()
1723 buf[aeb->pnum] = 1; in self_check_ai()
1725 list_for_each_entry(aeb, &ai->erase, u.list) in self_check_ai()
1726 buf[aeb->pnum] = 1; in self_check_ai()
1728 list_for_each_entry(aeb, &ai->alien, u.list) in self_check_ai()
1729 buf[aeb->pnum] = 1; in self_check_ai()
1744 ubi_err(ubi, "bad attaching information about LEB %d", aeb->lnum); in self_check_ai()
1745 ubi_dump_aeb(aeb, 0); in self_check_ai()