Lines Matching defs:pnum
125 static int self_check_ec(struct ubi_device *ubi, int pnum, int ec);
155 ubi_assert(e->pnum != e1->pnum);
156 if (e->pnum < e1->pnum)
177 ubi->lookuptbl[e->pnum] = NULL;
246 if (e->pnum == e1->pnum) {
256 ubi_assert(e->pnum != e1->pnum);
257 if (e->pnum < e1->pnum)
306 dbg_wl("added PEB %d EC %d to the protection queue", e->pnum, e->ec);
400 dbg_wl("PEB %d EC %d", e->pnum, e->ec);
408 * @pnum: the physical eraseblock to remove
410 * This function deletes PEB @pnum from the protection queue and returns zero
413 static int prot_queue_del(struct ubi_device *ubi, int pnum)
417 e = ubi->lookuptbl[pnum];
425 dbg_wl("deleted PEB %d from the protection queue", e->pnum);
445 dbg_wl("erase PEB %d, old EC %llu", e->pnum, ec);
447 err = self_check_ec(ubi, e->pnum, e->ec);
455 err = ubi_io_sync_erase(ubi, e->pnum, torture);
466 e->pnum, ec);
471 dbg_wl("erased PEB %d, new EC %llu", e->pnum, ec);
475 err = ubi_io_write_ec_hdr(ubi, e->pnum, ec_hdr);
512 e->pnum, e->ec);
591 e->pnum, e->ec, torture);
625 dbg_wl("sync erase of PEB %i", e->pnum);
714 dbg_wl("anchor-move PEB %d to PEB %d", e1->pnum, e2->pnum);
742 e1->pnum, e1->ec, e2->pnum, e2->ec);
753 dbg_wl("scrub PEB %d to PEB %d", e1->pnum, e2->pnum);
761 * Now we are going to copy physical eraseblock @e1->pnum to @e2->pnum.
771 err = ubi_io_read_vid_hdr(ubi, e1->pnum, vidb, 0);
785 dbg_wl("PEB %d has no VID header", e1->pnum);
795 e1->pnum);
805 e1->pnum);
811 err, e1->pnum);
818 err = ubi_eba_copy_leb(ubi, e1->pnum, e2->pnum, vidb);
875 e1->pnum, vol_id, lnum, e2->pnum);
903 e2->pnum, vol_id, lnum);
922 e1->pnum, vol_id, lnum, e2->pnum, err);
925 e1->pnum, e2->pnum, err);
968 err, e1->pnum, e2->pnum);
971 err, e1->pnum, vol_id, lnum, e2->pnum);
1079 int pnum = e->pnum;
1085 pnum, e->ec, wl_wrk->vol_id, wl_wrk->lnum);
1092 e->pnum < UBI_FM_MAX_START) {
1117 ubi_err(ubi, "failed to erase PEB %d, error %d", pnum, err);
1149 ubi_err(ubi, "bad physical eraseblock %d detected", pnum);
1165 ubi_msg(ubi, "mark PEB %d as bad", pnum);
1166 err = ubi_io_mark_bad(ubi, pnum);
1214 dbg_wl("cancel erasure of PEB %d EC %d", e->pnum, e->ec);
1230 * @pnum: physical eraseblock to return
1233 * This function is called to return physical eraseblock @pnum to the pool of
1235 * occurred to this @pnum and it has to be tested. This function returns zero
1239 int pnum, int torture)
1244 dbg_wl("PEB %d", pnum);
1245 ubi_assert(pnum >= 0);
1246 ubi_assert(pnum < ubi->peb_count);
1252 e = ubi->lookuptbl[pnum];
1271 dbg_wl("PEB %d is being moved, wait", pnum);
1288 dbg_wl("PEB %d is the target of data moving", pnum);
1309 err = prot_queue_del(ubi, e->pnum);
1311 ubi_err(ubi, "PEB %d not found", pnum);
1335 * @pnum: the physical eraseblock to schedule
1342 int ubi_wl_scrub_peb(struct ubi_device *ubi, int pnum)
1346 ubi_msg(ubi, "schedule PEB %d for scrubbing", pnum);
1350 e = ubi->lookuptbl[pnum];
1365 dbg_wl("the PEB %d is not in proper tree, retry", pnum);
1376 err = prot_queue_del(ubi, e->pnum);
1378 ubi_err(ubi, "PEB %d not found", pnum);
1475 * @pnum: the physical eraseblock to schedule
1491 int ubi_bitflip_check(struct ubi_device *ubi, int pnum, int force)
1496 if (pnum < 0 || pnum >= ubi->peb_count) {
1512 e = ubi->lookuptbl[pnum];
1531 err = ubi_io_read(ubi, ubi->peb_buf, pnum, 0, ubi->peb_size);
1545 e = ubi->lookuptbl[pnum];
1562 prot_queue_del(ubi, e->pnum);
1737 e->pnum = aeb->pnum;
1739 ubi->lookuptbl[e->pnum] = e;
1816 e->pnum = aeb->pnum;
1823 ubi->lookuptbl[e->pnum] = e;
1838 e->pnum = aeb->pnum;
1840 ubi->lookuptbl[e->pnum] = e;
1844 e->pnum, e->ec);
1848 e->pnum, e->ec);
1859 e = ubi_find_fm_block(ubi, aeb->pnum);
1862 ubi_assert(!ubi->lookuptbl[e->pnum]);
1863 ubi->lookuptbl[e->pnum] = e;
1873 if (ubi->lookuptbl[aeb->pnum])
1972 * @pnum: the physical eraseblock number to check
1975 * This function returns zero if the erase counter of physical eraseblock @pnum
1979 static int self_check_ec(struct ubi_device *ubi, int pnum, int ec)
1992 err = ubi_io_read_ec_hdr(ubi, pnum, ec_hdr, 0);
2001 ubi_err(ubi, "self-check failed for PEB %d", pnum);
2032 e->pnum, e->ec, root);
2055 e->pnum, e->ec);
2138 err = ubi_self_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset,
2141 ubi_err(ubi, "new PEB %d does not contain all 0xFF bytes", e->pnum);
2145 return e->pnum;