Lines Matching refs:pnum

131 static int self_check_ec(struct ubi_device *ubi, int pnum, int ec);
161 ubi_assert(e->pnum != e1->pnum); in wl_tree_add()
162 if (e->pnum < e1->pnum) in wl_tree_add()
183 ubi->lookuptbl[e->pnum] = NULL; in wl_entry_destroy()
252 if (e->pnum == e1->pnum) { in in_wl_tree()
262 ubi_assert(e->pnum != e1->pnum); in in_wl_tree()
263 if (e->pnum < e1->pnum) in in_wl_tree()
291 dbg_wl("added PEB %d EC %d to the protection queue", e->pnum, e->ec); in prot_queue_add()
331 !ubi->fm && e->pnum < UBI_FM_MAX_START) in find_wl_entry()
393 dbg_wl("PEB %d EC %d", e->pnum, e->ec); in wl_get_wle()
406 static int prot_queue_del(struct ubi_device *ubi, int pnum) in prot_queue_del() argument
410 e = ubi->lookuptbl[pnum]; in prot_queue_del()
418 dbg_wl("deleted PEB %d from the protection queue", e->pnum); in prot_queue_del()
438 dbg_wl("erase PEB %d, old EC %llu", e->pnum, ec); in sync_erase()
440 err = self_check_ec(ubi, e->pnum, e->ec); in sync_erase()
448 err = ubi_io_sync_erase(ubi, e->pnum, torture); in sync_erase()
459 e->pnum, ec); in sync_erase()
464 dbg_wl("erased PEB %d, new EC %llu", e->pnum, ec); in sync_erase()
468 err = ubi_io_write_ec_hdr(ubi, e->pnum, ec_hdr); in sync_erase()
505 e->pnum, e->ec); in serve_prot_queue()
612 e->pnum, e->ec, torture); in schedule_erase()
646 dbg_wl("sync erase of PEB %i", e->pnum); in do_sync_erase()
727 dbg_wl("anchor-move PEB %d to PEB %d", e1->pnum, e2->pnum);
754 e1->pnum, e1->ec, e2->pnum, e2->ec);
765 dbg_wl("scrub PEB %d to PEB %d", e1->pnum, e2->pnum);
783 err = ubi_io_read_vid_hdr(ubi, e1->pnum, vid_hdr, 0);
796 dbg_wl("PEB %d has no VID header", e1->pnum);
806 e1->pnum);
812 err, e1->pnum);
819 err = ubi_eba_copy_leb(ubi, e1->pnum, e2->pnum, vid_hdr);
872 e1->pnum, vol_id, lnum, e2->pnum);
897 e2->pnum, vol_id, lnum);
915 e1->pnum, vol_id, lnum, e2->pnum, err);
918 e1->pnum, e2->pnum, err);
945 err, e1->pnum, e2->pnum);
948 err, e1->pnum, vol_id, lnum, e2->pnum);
1065 int pnum = e->pnum; local
1071 dbg_wl("cancel erasure of PEB %d EC %d", pnum, e->ec);
1078 pnum, e->ec, wl_wrk->vol_id, wl_wrk->lnum);
1101 ubi_err(ubi, "failed to erase PEB %d, error %d", pnum, err);
1129 ubi_err(ubi, "bad physical eraseblock %d detected", pnum);
1145 ubi_msg(ubi, "mark PEB %d as bad", pnum);
1146 err = ubi_io_mark_bad(ubi, pnum);
1200 int pnum, int torture) argument
1205 dbg_wl("PEB %d", pnum);
1206 ubi_assert(pnum >= 0);
1207 ubi_assert(pnum < ubi->peb_count);
1213 e = ubi->lookuptbl[pnum];
1220 dbg_wl("PEB %d is being moved, wait", pnum);
1237 dbg_wl("PEB %d is the target of data moving", pnum);
1258 err = prot_queue_del(ubi, e->pnum);
1260 ubi_err(ubi, "PEB %d not found", pnum);
1291 int ubi_wl_scrub_peb(struct ubi_device *ubi, int pnum) argument
1295 ubi_msg(ubi, "schedule PEB %d for scrubbing", pnum);
1299 e = ubi->lookuptbl[pnum];
1314 dbg_wl("the PEB %d is not in proper tree, retry", pnum);
1325 err = prot_queue_del(ubi, e->pnum);
1327 ubi_err(ubi, "PEB %d not found", pnum);
1562 e->pnum = aeb->pnum;
1564 ubi->lookuptbl[e->pnum] = e;
1580 e->pnum = aeb->pnum;
1587 ubi->lookuptbl[e->pnum] = e;
1600 e->pnum = aeb->pnum;
1602 ubi->lookuptbl[e->pnum] = e;
1606 e->pnum, e->ec);
1610 e->pnum, e->ec);
1626 ubi->lookuptbl[e->pnum] = e;
1706 static int self_check_ec(struct ubi_device *ubi, int pnum, int ec) argument
1719 err = ubi_io_read_ec_hdr(ubi, pnum, ec_hdr, 0);
1728 ubi_err(ubi, "self-check failed for PEB %d", pnum);
1759 e->pnum, e->ec, root);
1787 e->pnum, e->ec);
1870 err = ubi_self_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset,
1873 ubi_err(ubi, "new PEB %d does not contain all 0xFF bytes", e->pnum);
1877 return e->pnum;