Lines Matching refs:pnum

319 	int err, pnum, vol_id = vol->vol_id;  in ubi_eba_unmap_leb()  local
328 pnum = vol->eba_tbl[lnum]; in ubi_eba_unmap_leb()
329 if (pnum < 0) in ubi_eba_unmap_leb()
333 dbg_eba("erase LEB %d:%d, PEB %d", vol_id, lnum, pnum); in ubi_eba_unmap_leb()
338 err = ubi_wl_put_peb(ubi, vol_id, lnum, pnum, 0); in ubi_eba_unmap_leb()
367 int err, pnum, scrub = 0, vol_id = vol->vol_id; in ubi_eba_read_leb() local
375 pnum = vol->eba_tbl[lnum]; in ubi_eba_read_leb()
376 if (pnum < 0) { in ubi_eba_read_leb()
391 len, offset, vol_id, lnum, pnum); in ubi_eba_read_leb()
404 err = ubi_io_read_vid_hdr(ubi, pnum, vid_hdr, 1); in ubi_eba_read_leb()
418 pnum, vol_id, lnum); in ubi_eba_read_leb()
436 err = ubi_io_read_data(ubi, buf, pnum, offset, len); in ubi_eba_read_leb()
464 err = ubi_wl_scrub_peb(ubi, pnum); in ubi_eba_read_leb()
549 static int recover_peb(struct ubi_device *ubi, int pnum, int vol_id, int lnum, in recover_peb() argument
569 pnum, new_pnum); in recover_peb()
571 err = ubi_io_read_vid_hdr(ubi, pnum, vid_hdr, 1); in recover_peb()
592 err = ubi_io_read_data(ubi, ubi->peb_buf, pnum, 0, offset); in recover_peb()
613 ubi_wl_put_peb(ubi, vol_id, lnum, pnum, 1); in recover_peb()
657 int err, pnum, tries = 0, vol_id = vol->vol_id; in ubi_eba_write_leb() local
667 pnum = vol->eba_tbl[lnum]; in ubi_eba_write_leb()
668 if (pnum >= 0) { in ubi_eba_write_leb()
670 len, offset, vol_id, lnum, pnum); in ubi_eba_write_leb()
672 err = ubi_io_write_data(ubi, buf, pnum, offset, len); in ubi_eba_write_leb()
674 ubi_warn(ubi, "failed to write data to PEB %d", pnum); in ubi_eba_write_leb()
676 err = recover_peb(ubi, pnum, vol_id, lnum, buf, in ubi_eba_write_leb()
703 pnum = ubi_wl_get_peb(ubi); in ubi_eba_write_leb()
704 if (pnum < 0) { in ubi_eba_write_leb()
708 return pnum; in ubi_eba_write_leb()
712 len, offset, vol_id, lnum, pnum); in ubi_eba_write_leb()
714 err = ubi_io_write_vid_hdr(ubi, pnum, vid_hdr); in ubi_eba_write_leb()
717 vol_id, lnum, pnum); in ubi_eba_write_leb()
723 err = ubi_io_write_data(ubi, buf, pnum, offset, len); in ubi_eba_write_leb()
726 len, offset, vol_id, lnum, pnum); in ubi_eba_write_leb()
732 vol->eba_tbl[lnum] = pnum; in ubi_eba_write_leb()
752 err = ubi_wl_put_peb(ubi, vol_id, lnum, pnum, 1); in ubi_eba_write_leb()
790 int err, pnum, tries = 0, data_size = len, vol_id = vol->vol_id; in ubi_eba_write_leb_st() local
826 pnum = ubi_wl_get_peb(ubi); in ubi_eba_write_leb_st()
827 if (pnum < 0) { in ubi_eba_write_leb_st()
831 return pnum; in ubi_eba_write_leb_st()
835 len, vol_id, lnum, pnum, used_ebs); in ubi_eba_write_leb_st()
837 err = ubi_io_write_vid_hdr(ubi, pnum, vid_hdr); in ubi_eba_write_leb_st()
840 vol_id, lnum, pnum); in ubi_eba_write_leb_st()
845 err = ubi_io_write_data(ubi, buf, pnum, 0, len); in ubi_eba_write_leb_st()
848 len, pnum); in ubi_eba_write_leb_st()
854 vol->eba_tbl[lnum] = pnum; in ubi_eba_write_leb_st()
874 err = ubi_wl_put_peb(ubi, vol_id, lnum, pnum, 1); in ubi_eba_write_leb_st()
907 int err, pnum, old_pnum, tries = 0, vol_id = vol->vol_id; in ubi_eba_atomic_leb_change() local
947 pnum = ubi_wl_get_peb(ubi); in ubi_eba_atomic_leb_change()
948 if (pnum < 0) { in ubi_eba_atomic_leb_change()
949 err = pnum; in ubi_eba_atomic_leb_change()
955 vol_id, lnum, vol->eba_tbl[lnum], pnum); in ubi_eba_atomic_leb_change()
957 err = ubi_io_write_vid_hdr(ubi, pnum, vid_hdr); in ubi_eba_atomic_leb_change()
960 vol_id, lnum, pnum); in ubi_eba_atomic_leb_change()
965 err = ubi_io_write_data(ubi, buf, pnum, 0, len); in ubi_eba_atomic_leb_change()
968 len, pnum); in ubi_eba_atomic_leb_change()
974 vol->eba_tbl[lnum] = pnum; in ubi_eba_atomic_leb_change()
1001 err = ubi_wl_put_peb(ubi, vol_id, lnum, pnum, 1); in ubi_eba_atomic_leb_change()
1339 scan_eba[i][aeb->lnum] = aeb->pnum; in self_check_eba()
1346 fm_eba[i][aeb->lnum] = aeb->pnum; in self_check_eba()
1430 vol->eba_tbl[aeb->lnum] = aeb->pnum; in ubi_eba_init()