Lines Matching refs:new_fm
1131 struct ubi_fastmap_layout *new_fm) in ubi_write_fastmap() argument
1188 fmsb->used_blocks = cpu_to_be32(new_fm->used_blocks); in ubi_write_fastmap()
1336 dbg_bld("writing fastmap SB to PEB %i", new_fm->e[0]->pnum); in ubi_write_fastmap()
1337 ret = ubi_io_write_vid_hdr(ubi, new_fm->e[0]->pnum, avbuf); in ubi_write_fastmap()
1343 for (i = 0; i < new_fm->used_blocks; i++) { in ubi_write_fastmap()
1344 fmsb->block_loc[i] = cpu_to_be32(new_fm->e[i]->pnum); in ubi_write_fastmap()
1345 set_seen(ubi, new_fm->e[i]->pnum, seen_pebs); in ubi_write_fastmap()
1346 fmsb->block_ec[i] = cpu_to_be32(new_fm->e[i]->ec); in ubi_write_fastmap()
1353 for (i = 1; i < new_fm->used_blocks; i++) { in ubi_write_fastmap()
1357 new_fm->e[i]->pnum, be64_to_cpu(dvhdr->sqnum)); in ubi_write_fastmap()
1358 ret = ubi_io_write_vid_hdr(ubi, new_fm->e[i]->pnum, dvbuf); in ubi_write_fastmap()
1361 new_fm->e[i]->pnum); in ubi_write_fastmap()
1366 for (i = 0; i < new_fm->used_blocks; i++) { in ubi_write_fastmap()
1368 new_fm->e[i]->pnum, 0, ubi->leb_size); in ubi_write_fastmap()
1371 new_fm->e[i]->pnum); in ubi_write_fastmap()
1376 ubi_assert(new_fm); in ubi_write_fastmap()
1377 ubi->fm = new_fm; in ubi_write_fastmap()
1539 struct ubi_fastmap_layout *new_fm, *old_fm; in ubi_update_fastmap() local
1555 new_fm = kzalloc(sizeof(*new_fm), GFP_KERNEL); in ubi_update_fastmap()
1556 if (!new_fm) { in ubi_update_fastmap()
1563 new_fm->used_blocks = ubi->fm_size / ubi->leb_size; in ubi_update_fastmap()
1567 if (new_fm->used_blocks > UBI_FM_MAX_BLOCKS) { in ubi_update_fastmap()
1573 for (i = 1; i < new_fm->used_blocks; i++) { in ubi_update_fastmap()
1585 ubi_wl_put_fm_peb(ubi, new_fm->e[j], in ubi_update_fastmap()
1587 new_fm->e[j] = NULL; in ubi_update_fastmap()
1591 new_fm->e[i] = old_fm->e[i]; in ubi_update_fastmap()
1597 ubi_wl_put_fm_peb(ubi, new_fm->e[j], j, 0); in ubi_update_fastmap()
1598 new_fm->e[j] = NULL; in ubi_update_fastmap()
1605 new_fm->e[i] = tmp_e; in ubi_update_fastmap()
1616 if (old_fm && new_fm->used_blocks < old_fm->used_blocks) { in ubi_update_fastmap()
1617 for (i = new_fm->used_blocks; i < old_fm->used_blocks; i++) { in ubi_update_fastmap()
1636 for (i = 1; i < new_fm->used_blocks; i++) { in ubi_update_fastmap()
1637 ubi_wl_put_fm_peb(ubi, new_fm->e[i], in ubi_update_fastmap()
1639 new_fm->e[i] = NULL; in ubi_update_fastmap()
1643 new_fm->e[0] = old_fm->e[0]; in ubi_update_fastmap()
1644 new_fm->e[0]->ec = ret; in ubi_update_fastmap()
1650 new_fm->e[0] = tmp_e; in ubi_update_fastmap()
1657 for (i = 1; i < new_fm->used_blocks; i++) { in ubi_update_fastmap()
1658 ubi_wl_put_fm_peb(ubi, new_fm->e[i], i, 0); in ubi_update_fastmap()
1659 new_fm->e[i] = NULL; in ubi_update_fastmap()
1665 new_fm->e[0] = tmp_e; in ubi_update_fastmap()
1668 ret = ubi_write_fastmap(ubi, new_fm); in ubi_update_fastmap()
1692 return_fm_pebs(ubi, new_fm); in ubi_update_fastmap()
1696 kfree(new_fm); in ubi_update_fastmap()