Lines Matching refs:pnum
61 int pnum; member
124 ldesc->pnum = vol->eba_tbl->entries[lnum].pnum; in ubi_eba_get_ldesc()
153 tbl->entries[i].pnum = UBI_LEB_UNMAPPED; in ubi_eba_create_table()
198 dst->entries[i].pnum = src->entries[i].pnum; in ubi_eba_copy_table()
451 return vol->eba_tbl->entries[lnum].pnum >= 0; in ubi_eba_is_mapped()
467 int err, pnum, vol_id = vol->vol_id; in ubi_eba_unmap_leb() local
476 pnum = vol->eba_tbl->entries[lnum].pnum; in ubi_eba_unmap_leb()
477 if (pnum < 0) in ubi_eba_unmap_leb()
481 dbg_eba("erase LEB %d:%d, PEB %d", vol_id, lnum, pnum); in ubi_eba_unmap_leb()
484 vol->eba_tbl->entries[lnum].pnum = UBI_LEB_UNMAPPED; in ubi_eba_unmap_leb()
486 err = ubi_wl_put_peb(ubi, vol_id, lnum, pnum, 0); in ubi_eba_unmap_leb()
515 int err, pnum, scrub = 0, vol_id = vol->vol_id; in ubi_eba_read_leb() local
524 pnum = vol->eba_tbl->entries[lnum].pnum; in ubi_eba_read_leb()
525 if (pnum < 0) { in ubi_eba_read_leb()
540 len, offset, vol_id, lnum, pnum); in ubi_eba_read_leb()
555 err = ubi_io_read_vid_hdr(ubi, pnum, vidb, 1); in ubi_eba_read_leb()
569 pnum, vol_id, lnum); in ubi_eba_read_leb()
604 err = ubi_io_read_data(ubi, buf, pnum, offset, len); in ubi_eba_read_leb()
632 err = ubi_wl_scrub_peb(ubi, pnum); in ubi_eba_read_leb()
717 static int try_recover_peb(struct ubi_volume *vol, int pnum, int lnum, in try_recover_peb() argument
735 pnum, new_pnum); in try_recover_peb()
737 err = ubi_io_read_vid_hdr(ubi, pnum, vidb, 1); in try_recover_peb()
752 err = ubi_io_read_data(ubi, ubi->peb_buf, pnum, 0, offset); in try_recover_peb()
777 vol->eba_tbl->entries[lnum].pnum = new_pnum; in try_recover_peb()
783 ubi_wl_put_peb(ubi, vol_id, lnum, pnum, 1); in try_recover_peb()
813 static int recover_peb(struct ubi_device *ubi, int pnum, int vol_id, int lnum, in recover_peb() argument
827 err = try_recover_peb(vol, pnum, lnum, buf, offset, len, vidb, in recover_peb()
860 int pnum, opnum, err, vol_id = vol->vol_id; in try_write_vid_and_data() local
862 pnum = ubi_wl_get_peb(ubi); in try_write_vid_and_data()
863 if (pnum < 0) { in try_write_vid_and_data()
864 err = pnum; in try_write_vid_and_data()
868 opnum = vol->eba_tbl->entries[lnum].pnum; in try_write_vid_and_data()
871 len, offset, vol_id, lnum, pnum); in try_write_vid_and_data()
873 err = ubi_io_write_vid_hdr(ubi, pnum, vidb); in try_write_vid_and_data()
876 vol_id, lnum, pnum); in try_write_vid_and_data()
881 err = ubi_io_write_data(ubi, buf, pnum, offset, len); in try_write_vid_and_data()
885 len, offset, vol_id, lnum, pnum); in try_write_vid_and_data()
890 vol->eba_tbl->entries[lnum].pnum = pnum; in try_write_vid_and_data()
895 if (err && pnum >= 0) in try_write_vid_and_data()
896 err = ubi_wl_put_peb(ubi, vol_id, lnum, pnum, 1); in try_write_vid_and_data()
921 int err, pnum, tries, vol_id = vol->vol_id; in ubi_eba_write_leb() local
932 pnum = vol->eba_tbl->entries[lnum].pnum; in ubi_eba_write_leb()
933 if (pnum >= 0) { in ubi_eba_write_leb()
935 len, offset, vol_id, lnum, pnum); in ubi_eba_write_leb()
937 err = ubi_io_write_data(ubi, buf, pnum, offset, len); in ubi_eba_write_leb()
939 ubi_warn(ubi, "failed to write data to PEB %d", pnum); in ubi_eba_write_leb()
941 err = recover_peb(ubi, pnum, vol_id, lnum, buf, in ubi_eba_write_leb()
1054 ubi_assert(vol->eba_tbl->entries[lnum].pnum < 0); in ubi_eba_write_leb_st()
1270 if (vol->eba_tbl->entries[lnum].pnum != from) { in ubi_eba_copy_leb()
1272 vol_id, lnum, from, vol->eba_tbl->entries[lnum].pnum); in ubi_eba_copy_leb()
1357 ubi_assert(vol->eba_tbl->entries[lnum].pnum == from); in ubi_eba_copy_leb()
1358 vol->eba_tbl->entries[lnum].pnum = to; in ubi_eba_copy_leb()
1467 scan_eba[i][aeb->lnum] = aeb->pnum; in self_check_eba()
1474 fm_eba[i][aeb->lnum] = aeb->pnum; in self_check_eba()
1561 entry->pnum = aeb->pnum; in ubi_eba_init()