Lines Matching refs:new_fm
1130 struct ubi_fastmap_layout *new_fm) in ubi_write_fastmap() argument
1187 fmsb->used_blocks = cpu_to_be32(new_fm->used_blocks); in ubi_write_fastmap()
1335 dbg_bld("writing fastmap SB to PEB %i", new_fm->e[0]->pnum); in ubi_write_fastmap()
1336 ret = ubi_io_write_vid_hdr(ubi, new_fm->e[0]->pnum, avbuf); in ubi_write_fastmap()
1342 for (i = 0; i < new_fm->used_blocks; i++) { in ubi_write_fastmap()
1343 fmsb->block_loc[i] = cpu_to_be32(new_fm->e[i]->pnum); in ubi_write_fastmap()
1344 set_seen(ubi, new_fm->e[i]->pnum, seen_pebs); in ubi_write_fastmap()
1345 fmsb->block_ec[i] = cpu_to_be32(new_fm->e[i]->ec); in ubi_write_fastmap()
1352 for (i = 1; i < new_fm->used_blocks; i++) { in ubi_write_fastmap()
1356 new_fm->e[i]->pnum, be64_to_cpu(dvhdr->sqnum)); in ubi_write_fastmap()
1357 ret = ubi_io_write_vid_hdr(ubi, new_fm->e[i]->pnum, dvbuf); in ubi_write_fastmap()
1360 new_fm->e[i]->pnum); in ubi_write_fastmap()
1365 for (i = 0; i < new_fm->used_blocks; i++) { in ubi_write_fastmap()
1367 new_fm->e[i]->pnum, 0, ubi->leb_size); in ubi_write_fastmap()
1370 new_fm->e[i]->pnum); in ubi_write_fastmap()
1375 ubi_assert(new_fm); in ubi_write_fastmap()
1376 ubi->fm = new_fm; in ubi_write_fastmap()
1538 struct ubi_fastmap_layout *new_fm, *old_fm; in ubi_update_fastmap() local
1554 new_fm = kzalloc(sizeof(*new_fm), GFP_KERNEL); in ubi_update_fastmap()
1555 if (!new_fm) { in ubi_update_fastmap()
1562 new_fm->used_blocks = ubi->fm_size / ubi->leb_size; in ubi_update_fastmap()
1566 if (new_fm->used_blocks > UBI_FM_MAX_BLOCKS) { in ubi_update_fastmap()
1572 for (i = 1; i < new_fm->used_blocks; i++) { in ubi_update_fastmap()
1584 ubi_wl_put_fm_peb(ubi, new_fm->e[j], in ubi_update_fastmap()
1586 new_fm->e[j] = NULL; in ubi_update_fastmap()
1590 new_fm->e[i] = old_fm->e[i]; in ubi_update_fastmap()
1596 ubi_wl_put_fm_peb(ubi, new_fm->e[j], j, 0); in ubi_update_fastmap()
1597 new_fm->e[j] = NULL; in ubi_update_fastmap()
1604 new_fm->e[i] = tmp_e; in ubi_update_fastmap()
1615 if (old_fm && new_fm->used_blocks < old_fm->used_blocks) { in ubi_update_fastmap()
1616 for (i = new_fm->used_blocks; i < old_fm->used_blocks; i++) { in ubi_update_fastmap()
1635 for (i = 1; i < new_fm->used_blocks; i++) { in ubi_update_fastmap()
1636 ubi_wl_put_fm_peb(ubi, new_fm->e[i], in ubi_update_fastmap()
1638 new_fm->e[i] = NULL; in ubi_update_fastmap()
1642 new_fm->e[0] = old_fm->e[0]; in ubi_update_fastmap()
1643 new_fm->e[0]->ec = ret; in ubi_update_fastmap()
1649 new_fm->e[0] = tmp_e; in ubi_update_fastmap()
1656 for (i = 1; i < new_fm->used_blocks; i++) { in ubi_update_fastmap()
1657 ubi_wl_put_fm_peb(ubi, new_fm->e[i], i, 0); in ubi_update_fastmap()
1658 new_fm->e[i] = NULL; in ubi_update_fastmap()
1664 new_fm->e[0] = tmp_e; in ubi_update_fastmap()
1667 ret = ubi_write_fastmap(ubi, new_fm); in ubi_update_fastmap()
1691 return_fm_pebs(ubi, new_fm); in ubi_update_fastmap()
1695 kfree(new_fm); in ubi_update_fastmap()