Home | History | Annotate | Download | only in ubi

Lines Matching defs:pnum

51  * @pnum: The PEB to be makred as seen
54 static inline void set_seen(struct ubi_device *ubi, int pnum, int *seen)
59 seen[pnum] = 1;
69 int pnum, ret = 0;
74 for (pnum = 0; pnum < ubi->peb_count; pnum++) {
75 if (!seen[pnum] && ubi->lookuptbl[pnum]) {
76 ubi_err(ubi, "self-check failed for PEB %d, fastmap didn't see it", pnum);
136 * @pnum: PEB number of the new attach erase block
143 int pnum, int ec, int scrub)
151 aeb->pnum = pnum;
297 if (aeb->pnum == new_aeb->pnum) {
304 cmp_res = ubi_compare_lebs(ubi, aeb, new_aeb->pnum, new_vh);
316 victim->pnum = aeb->pnum;
324 av->vol_id, aeb->lnum, new_aeb->pnum);
327 aeb->pnum = new_aeb->pnum;
335 av->vol_id, aeb->lnum, new_aeb->pnum);
417 * @pnum: The PEB to be unmapped
419 static void unmap_peb(struct ubi_attach_info *ai, int pnum)
431 if (aeb->pnum == pnum) {
466 int i, pnum, err, ret = 0;
488 pnum = be32_to_cpu(pebs[i]);
490 if (ubi_io_is_bad(ubi, pnum)) {
496 err = ubi_io_read_ec_hdr(ubi, pnum, ech, 0);
499 pnum, err);
518 err = ubi_io_read_vid_hdr(ubi, pnum, vh, 0);
521 unmap_peb(ai, pnum);
522 dbg_bld("Adding PEB to free: %i", pnum);
524 add_aeb(ai, free, pnum, ec, 1);
526 add_aeb(ai, free, pnum, ec, 0);
529 dbg_bld("Found non empty PEB:%i in pool", pnum);
542 new_aeb->pnum = pnum;
699 add_aeb(ai, &ai->free, be32_to_cpu(fmec->pnum),
710 add_aeb(ai, &used, be32_to_cpu(fmec->pnum),
721 add_aeb(ai, &used, be32_to_cpu(fmec->pnum),
732 add_aeb(ai, &ai->erase, be32_to_cpu(fmec->pnum),
783 int pnum = be32_to_cpu(fm_eba->pnum[j]);
785 if ((int)be32_to_cpu(fm_eba->pnum[j]) < 0)
790 if (tmp_aeb->pnum == pnum) {
797 ubi_err(ubi, "PEB %i is in EBA but not in used list", pnum);
809 aeb->pnum, aeb->lnum, av->vol_id);
884 int i, used_blocks, pnum, ret = 0;
956 pnum = be32_to_cpu(fmsb->block_loc[i]);
958 if (ubi_io_is_bad(ubi, pnum)) {
963 ret = ubi_io_read_ec_hdr(ubi, pnum, ech, 0);
966 i, pnum);
988 ret = ubi_io_read_vid_hdr(ubi, pnum, vh, 0);
991 i, pnum);
1016 ret = ubi_io_read(ubi, ubi->fm_buf + (ubi->leb_size * i), pnum,
1020 "err: %i)", i, pnum, ret);
1063 e->pnum = be32_to_cpu(fmsb2->block_loc[i]);
1191 fec->pnum = cpu_to_be32(wl_e->pnum);
1192 set_seen(ubi, wl_e->pnum, seen_pebs);
1204 fec->pnum = cpu_to_be32(wl_e->pnum);
1205 set_seen(ubi, wl_e->pnum, seen_pebs);
1216 fec->pnum = cpu_to_be32(wl_e->pnum);
1217 set_seen(ubi, wl_e->pnum, seen_pebs);
1229 fec->pnum = cpu_to_be32(wl_e->pnum);
1230 set_seen(ubi, wl_e->pnum, seen_pebs);
1247 fec->pnum = cpu_to_be32(wl_e->pnum);
1248 set_seen(ubi, wl_e->pnum, seen_pebs);
1285 feba->pnum[j] = cpu_to_be32(vol->eba_tbl[j]);
1299 dbg_bld("writing fastmap SB to PEB %i", new_fm->e[0]->pnum);
1300 ret = ubi_io_write_vid_hdr(ubi, new_fm->e[0]->pnum, avhdr);
1307 fmsb->block_loc[i] = cpu_to_be32(new_fm->e[i]->pnum);
1308 set_seen(ubi, new_fm->e[i]->pnum, seen_pebs);
1320 new_fm->e[i]->pnum, be64_to_cpu(dvhdr->sqnum));
1321 ret = ubi_io_write_vid_hdr(ubi, new_fm->e[i]->pnum, dvhdr);
1324 new_fm->e[i]->pnum);
1331 new_fm->e[i]->pnum, ubi->leb_start, ubi->leb_size);
1334 new_fm->e[i]->pnum);
1356 * @pnum: PEB to be erased
1360 static int erase_block(struct ubi_device *ubi, int pnum)
1370 ret = ubi_io_read_ec_hdr(ubi, pnum, ec_hdr, 0);
1378 ret = ubi_io_sync_erase(ubi, pnum, 0);
1390 ret = ubi_io_write_ec_hdr(ubi, pnum, ec_hdr);
1443 ret = ubi_io_write_vid_hdr(ubi, e->pnum, vh);
1537 ret = erase_block(ubi, old_fm->e[i]->pnum);
1588 ret = erase_block(ubi, old_fm->e[0]->pnum);