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);
718 dbg_wl("anchor-move PEB %d to PEB %d", e1->pnum, e2->pnum);
746 e1->pnum, e1->ec, e2->pnum, e2->ec);
757 dbg_wl("scrub PEB %d to PEB %d", e1->pnum, e2->pnum);
765 * Now we are going to copy physical eraseblock @e1->pnum to @e2->pnum.
775 err = ubi_io_read_vid_hdr(ubi, e1->pnum, vidb, 0);
789 dbg_wl("PEB %d has no VID header", e1->pnum);
799 e1->pnum);
809 e1->pnum);
815 err, e1->pnum);
822 err = ubi_eba_copy_leb(ubi, e1->pnum, e2->pnum, vidb);
879 e1->pnum, vol_id, lnum, e2->pnum);
907 e2->pnum, vol_id, lnum);
926 e1->pnum, vol_id, lnum, e2->pnum, err);
929 e1->pnum, e2->pnum, err);
972 err, e1->pnum, e2->pnum);
975 err, e1->pnum, vol_id, lnum, e2->pnum);
1089 int pnum = e->pnum;
1095 pnum, e->ec, wl_wrk->vol_id, wl_wrk->lnum);
1102 e->pnum < UBI_FM_MAX_START) {
1127 ubi_err(ubi, "failed to erase PEB %d, error %d", pnum, err);
1159 ubi_err(ubi, "bad physical eraseblock %d detected", pnum);
1175 ubi_msg(ubi, "mark PEB %d as bad", pnum);
1176 err = ubi_io_mark_bad(ubi, pnum);
1224 dbg_wl("cancel erasure of PEB %d EC %d", e->pnum, e->ec);
1240 * @pnum: physical eraseblock to return
1243 * This function is called to return physical eraseblock @pnum to the pool of
1245 * occurred to this @pnum and it has to be tested. This function returns zero
1249 int pnum, int torture)
1254 dbg_wl("PEB %d", pnum);
1255 ubi_assert(pnum >= 0);
1256 ubi_assert(pnum < ubi->peb_count);
1262 e = ubi->lookuptbl[pnum];
1281 dbg_wl("PEB %d is being moved, wait", pnum);
1298 dbg_wl("PEB %d is the target of data moving", pnum);
1319 err = prot_queue_del(ubi, e->pnum);
1321 ubi_err(ubi, "PEB %d not found", pnum);
1345 * @pnum: the physical eraseblock to schedule
1352 int ubi_wl_scrub_peb(struct ubi_device *ubi, int pnum)
1356 ubi_msg(ubi, "schedule PEB %d for scrubbing", pnum);
1360 e = ubi->lookuptbl[pnum];
1375 dbg_wl("the PEB %d is not in proper tree, retry", pnum);
1386 err = prot_queue_del(ubi, e->pnum);
1388 ubi_err(ubi, "PEB %d not found", pnum);
1485 * @pnum: the physical eraseblock to schedule
1501 int ubi_bitflip_check(struct ubi_device *ubi, int pnum, int force)
1506 if (pnum < 0 || pnum >= ubi->peb_count) {
1522 e = ubi->lookuptbl[pnum];
1541 err = ubi_io_read(ubi, ubi->peb_buf, pnum, 0, ubi->peb_size);
1555 e = ubi->lookuptbl[pnum];
1572 prot_queue_del(ubi, e->pnum);
1747 e->pnum = aeb->pnum;
1749 ubi->lookuptbl[e->pnum] = e;
1826 e->pnum = aeb->pnum;
1833 ubi->lookuptbl[e->pnum] = e;
1848 e->pnum = aeb->pnum;
1850 ubi->lookuptbl[e->pnum] = e;
1854 e->pnum, e->ec);
1858 e->pnum, e->ec);
1869 e = ubi_find_fm_block(ubi, aeb->pnum);
1872 ubi_assert(!ubi->lookuptbl[e->pnum]);
1873 ubi->lookuptbl[e->pnum] = e;
1883 if (ubi->lookuptbl[aeb->pnum])
1982 * @pnum: the physical eraseblock number to check
1985 * This function returns zero if the erase counter of physical eraseblock @pnum
1989 static int self_check_ec(struct ubi_device *ubi, int pnum, int ec)
2002 err = ubi_io_read_ec_hdr(ubi, pnum, ec_hdr, 0);
2011 ubi_err(ubi, "self-check failed for PEB %d", pnum);
2042 e->pnum, e->ec, root);
2065 e->pnum, e->ec);
2148 err = ubi_self_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset,
2151 ubi_err(ubi, "new PEB %d does not contain all 0xFF bytes", e->pnum);
2155 return e->pnum;