Lines Matching defs:pnum

170  * @pnum: physical eraseblock number
173 * Allocate an aeb object and initialize the pnum and ec information.
178 struct ubi_ainf_peb *ubi_alloc_aeb(struct ubi_attach_info *ai, int pnum,
187 aeb->pnum = pnum;
211 * @pnum: physical eraseblock number to add
219 * eraseblock @pnum and adds it to the "free", "erase", or "alien" lists.
229 static int add_to_list(struct ubi_attach_info *ai, int pnum, int vol_id,
235 dbg_bld("add to free: PEB %d, EC %d", pnum, ec);
237 dbg_bld("add to erase: PEB %d, EC %d", pnum, ec);
239 dbg_bld("add to alien: PEB %d, EC %d", pnum, ec);
244 aeb = ubi_alloc_aeb(ai, pnum, ec);
260 * @pnum: physical eraseblock number to add
264 * physical eraseblock @pnum and adds it to the 'corr' list. The corruption
268 static int add_corrupted(struct ubi_attach_info *ai, int pnum, int ec)
272 dbg_bld("add to corrupted: PEB %d, EC %d", pnum, ec);
274 aeb = ubi_alloc_aeb(ai, pnum, ec);
286 * @pnum: physical eraseblock number the VID header came from
291 * physical eraseblock @pnum and adds it to the 'fastmap' list.
296 static int add_fastmap(struct ubi_attach_info *ai, int pnum,
301 aeb = ubi_alloc_aeb(ai, pnum, ec);
309 dbg_bld("add to fastmap list: PEB %d, vol_id %d, sqnum: %llu", pnum,
320 * @pnum: physical eraseblock number the VID header came from
332 const struct ubi_ainf_volume *av, int pnum)
377 ubi_err(ubi, "inconsistent VID header at PEB %d", pnum);
387 * @pnum: physical eraseblock number
397 int vol_id, int pnum,
422 * @pnum: physical eraseblock number of the second logical eraseblock to
431 * second PEB (described by @pnum and @vid_hdr);
439 int pnum, const struct ubi_vid_hdr *vid_hdr)
475 pnum);
482 pnum);
490 pnum = aeb->pnum;
491 err = ubi_io_read_vid_hdr(ubi, pnum, vidb, 0);
497 pnum, err);
513 err = ubi_io_read_data(ubi, ubi->peb_buf, pnum, 0, len);
521 pnum, crc, data_crc);
526 dbg_bld("PEB %d CRC is OK", pnum);
534 dbg_bld("second PEB %d is newer, copy_flag is set", pnum);
536 dbg_bld("first PEB %d is newer, copy_flag is set", pnum);
551 * @pnum: the physical eraseblock number
563 int ubi_add_to_av(struct ubi_device *ubi, struct ubi_attach_info *ai, int pnum,
577 pnum, vol_id, lnum, ec, sqnum, bitflips);
579 av = add_volume(ai, vol_id, pnum, vid_hdr);
610 aeb->pnum, aeb->sqnum, aeb->ec);
637 cmp_res = ubi_compare_lebs(ubi, aeb, pnum, vid_hdr);
646 err = validate_vid_hdr(ubi, vid_hdr, av, pnum);
650 err = add_to_list(ai, aeb->pnum, aeb->vol_id,
657 aeb->pnum = pnum;
674 return add_to_list(ai, pnum, vol_id, lnum, ec,
684 err = validate_vid_hdr(ubi, vid_hdr, av, pnum);
688 aeb = ubi_alloc_aeb(ai, pnum, ec);
762 * @pnum: physical eraseblock number to erase;
765 * This function erases physical eraseblock 'pnum', and writes the erase
772 const struct ubi_attach_info *ai, int pnum, int ec)
783 pnum, ec);
793 err = ubi_io_sync_erase(ubi, pnum, 0);
797 err = ubi_io_write_ec_hdr(ubi, pnum, ec_hdr);
827 dbg_bld("return free PEB %d, EC %d", aeb->pnum, aeb->ec);
841 err = early_erase_peb(ubi, ai, aeb->pnum, aeb->ec+1);
847 dbg_bld("return PEB %d, EC %d", aeb->pnum, aeb->ec);
859 * @pnum: the physical eraseblock number to check
873 int pnum)
880 err = ubi_io_read(ubi, ubi->peb_buf, pnum, ubi->leb_start,
901 pnum);
905 pnum, ubi->leb_start, ubi->leb_size);
933 * @pnum: the physical eraseblock number
936 * This function reads UBI headers of PEB @pnum, checks them, and adds
942 int pnum, bool fast)
950 dbg_bld("scan PEB %d", pnum);
953 err = ubi_io_is_bad(ubi, pnum);
961 err = ubi_io_read_ec_hdr(ubi, pnum, ech, 0);
972 return add_to_list(ai, pnum, UBI_UNKNOWN, UBI_UNKNOWN,
976 return add_to_list(ai, pnum, UBI_UNKNOWN, UBI_UNKNOWN,
1036 image_seq, pnum, ubi->image_seq);
1044 err = ubi_io_read_vid_hdr(ubi, pnum, vidb, 0);
1097 err = check_corruption(ubi, vidh, pnum);
1103 err = add_to_list(ai, pnum, UBI_UNKNOWN,
1107 err = add_corrupted(ai, pnum, ec);
1112 err = add_to_list(ai, pnum, UBI_UNKNOWN, UBI_UNKNOWN,
1119 err = add_to_list(ai, pnum, UBI_UNKNOWN,
1122 err = add_to_list(ai, pnum, UBI_UNKNOWN,
1143 err = add_to_list(ai, pnum, vol_id, lnum,
1158 err = add_to_list(ai, pnum, vol_id, lnum,
1173 pnum);
1176 err = add_fastmap(ai, pnum, vidh, ec);
1178 err = ubi_add_to_av(ubi, ai, pnum, ec, vidh, bitflips);
1225 pr_cont(" %d", aeb->pnum);
1377 int err, pnum;
1392 for (pnum = start; pnum < ubi->peb_count; pnum++) {
1395 dbg_gen("process PEB %d", pnum);
1396 err = scan_peb(ubi, ai, pnum, false);
1489 int err, pnum;
1506 for (pnum = 0; pnum < UBI_FM_MAX_START; pnum++) {
1509 dbg_gen("process PEB %d", pnum);
1510 err = scan_peb(ubi, scan_ai, pnum, true);
1662 int pnum, err, vols_found = 0;
1723 if (aeb->pnum < 0 || aeb->ec < 0) {
1740 if (aeb->pnum >= ubi->peb_count) {
1742 aeb->pnum, ubi->peb_count);
1797 err = ubi_io_read_vid_hdr(ubi, aeb->pnum, vidb, 1);
1867 for (pnum = 0; pnum < ubi->peb_count; pnum++) {
1868 err = ubi_io_is_bad(ubi, pnum);
1873 buf[pnum] = 1;
1878 buf[aeb->pnum] = 1;
1881 buf[aeb->pnum] = 1;
1884 buf[aeb->pnum] = 1;
1887 buf[aeb->pnum] = 1;
1890 buf[aeb->pnum] = 1;
1893 for (pnum = 0; pnum < ubi->peb_count; pnum++)
1894 if (!buf[pnum]) {
1895 ubi_err(ubi, "PEB %d is not referred", pnum);