Lines Matching refs:pnum
130 static int self_check_ec(struct ubi_device *ubi, int pnum, int ec);
160 ubi_assert(e->pnum != e1->pnum); in wl_tree_add()
161 if (e->pnum < e1->pnum) in wl_tree_add()
182 ubi->lookuptbl[e->pnum] = NULL; in wl_entry_destroy()
251 if (e->pnum == e1->pnum) { in in_wl_tree()
261 ubi_assert(e->pnum != e1->pnum); in in_wl_tree()
262 if (e->pnum < e1->pnum) in in_wl_tree()
290 dbg_wl("added PEB %d EC %d to the protection queue", e->pnum, e->ec); in prot_queue_add()
330 !ubi->fm && e->pnum < UBI_FM_MAX_START) in find_wl_entry()
392 dbg_wl("PEB %d EC %d", e->pnum, e->ec); in wl_get_wle()
405 static int prot_queue_del(struct ubi_device *ubi, int pnum) in prot_queue_del() argument
409 e = ubi->lookuptbl[pnum]; in prot_queue_del()
417 dbg_wl("deleted PEB %d from the protection queue", e->pnum); in prot_queue_del()
437 dbg_wl("erase PEB %d, old EC %llu", e->pnum, ec); in sync_erase()
439 err = self_check_ec(ubi, e->pnum, e->ec); in sync_erase()
447 err = ubi_io_sync_erase(ubi, e->pnum, torture); in sync_erase()
458 e->pnum, ec); in sync_erase()
463 dbg_wl("erased PEB %d, new EC %llu", e->pnum, ec); in sync_erase()
467 err = ubi_io_write_ec_hdr(ubi, e->pnum, ec_hdr); in sync_erase()
504 e->pnum, e->ec); in serve_prot_queue()
611 e->pnum, e->ec, torture); in schedule_erase()
645 dbg_wl("sync erase of PEB %i", e->pnum); in do_sync_erase()
726 dbg_wl("anchor-move PEB %d to PEB %d", e1->pnum, e2->pnum);
753 e1->pnum, e1->ec, e2->pnum, e2->ec);
764 dbg_wl("scrub PEB %d to PEB %d", e1->pnum, e2->pnum);
782 err = ubi_io_read_vid_hdr(ubi, e1->pnum, vid_hdr, 0);
795 dbg_wl("PEB %d has no VID header", e1->pnum);
805 e1->pnum);
811 err, e1->pnum);
818 err = ubi_eba_copy_leb(ubi, e1->pnum, e2->pnum, vid_hdr);
871 e1->pnum, vol_id, lnum, e2->pnum);
896 e2->pnum, vol_id, lnum);
914 e1->pnum, vol_id, lnum, e2->pnum, err);
917 e1->pnum, e2->pnum, err);
944 err, e1->pnum, e2->pnum);
947 err, e1->pnum, vol_id, lnum, e2->pnum);
1064 int pnum = e->pnum; local
1070 dbg_wl("cancel erasure of PEB %d EC %d", pnum, e->ec);
1077 pnum, e->ec, wl_wrk->vol_id, wl_wrk->lnum);
1100 ubi_err(ubi, "failed to erase PEB %d, error %d", pnum, err);
1128 ubi_err(ubi, "bad physical eraseblock %d detected", pnum);
1144 ubi_msg(ubi, "mark PEB %d as bad", pnum);
1145 err = ubi_io_mark_bad(ubi, pnum);
1199 int pnum, int torture) argument
1204 dbg_wl("PEB %d", pnum);
1205 ubi_assert(pnum >= 0);
1206 ubi_assert(pnum < ubi->peb_count);
1212 e = ubi->lookuptbl[pnum];
1219 dbg_wl("PEB %d is being moved, wait", pnum);
1236 dbg_wl("PEB %d is the target of data moving", pnum);
1257 err = prot_queue_del(ubi, e->pnum);
1259 ubi_err(ubi, "PEB %d not found", pnum);
1290 int ubi_wl_scrub_peb(struct ubi_device *ubi, int pnum) argument
1294 ubi_msg(ubi, "schedule PEB %d for scrubbing", pnum);
1298 e = ubi->lookuptbl[pnum];
1313 dbg_wl("the PEB %d is not in proper tree, retry", pnum);
1324 err = prot_queue_del(ubi, e->pnum);
1326 ubi_err(ubi, "PEB %d not found", pnum);
1561 e->pnum = aeb->pnum;
1563 ubi->lookuptbl[e->pnum] = e;
1579 e->pnum = aeb->pnum;
1586 ubi->lookuptbl[e->pnum] = e;
1599 e->pnum = aeb->pnum;
1601 ubi->lookuptbl[e->pnum] = e;
1605 e->pnum, e->ec);
1609 e->pnum, e->ec);
1625 ubi->lookuptbl[e->pnum] = e;
1705 static int self_check_ec(struct ubi_device *ubi, int pnum, int ec) argument
1718 err = ubi_io_read_ec_hdr(ubi, pnum, ec_hdr, 0);
1727 ubi_err(ubi, "self-check failed for PEB %d", pnum);
1758 e->pnum, e->ec, root);
1786 e->pnum, e->ec);
1869 err = ubi_self_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset,
1872 ubi_err(ubi, "new PEB %d does not contain all 0xFF bytes", e->pnum);
1876 return e->pnum;