/linux/drivers/mtd/ubi/ |
A D | eba.c | 110 ldesc->lnum = lnum; in ubi_eba_get_ldesc() 211 int lnum) in ltree_lookup() argument 226 if (lnum < le->lnum) in ltree_lookup() 228 else if (lnum > le->lnum) in ltree_lookup() 261 le->lnum = lnum; in ltree_add_entry() 292 ubi_assert(lnum != le1->lnum); in ltree_add_entry() 293 if (lnum < le1->lnum) in ltree_add_entry() 1058 vid_hdr->lnum = cpu_to_be32(lnum); in ubi_eba_write_leb() 1139 vid_hdr->lnum = cpu_to_be32(lnum); in ubi_eba_write_leb_st() 1223 vid_hdr->lnum = cpu_to_be32(lnum); in ubi_eba_atomic_leb_change() [all …]
|
A D | kapi.c | 384 if (lnum == vol->used_ebs - 1 && in leb_read_sanity_check() 573 if (!ubi_leb_valid(vol, lnum) || len < 0 || in ubi_leb_change() 610 if (!ubi_leb_valid(vol, lnum)) in ubi_leb_erase() 616 err = ubi_eba_unmap_leb(ubi, vol, lnum); in ubi_leb_erase() 670 if (!ubi_leb_valid(vol, lnum)) in ubi_leb_unmap() 676 return ubi_eba_unmap_leb(ubi, vol, lnum); in ubi_leb_unmap() 706 if (!ubi_leb_valid(vol, lnum)) in ubi_leb_map() 712 if (ubi_eba_is_mapped(vol, lnum)) in ubi_leb_map() 741 if (!ubi_leb_valid(vol, lnum)) in ubi_is_mapped() 747 return ubi_eba_is_mapped(vol, lnum); in ubi_is_mapped() [all …]
|
A D | gluebi.c | 156 int err = 0, lnum, offs, bytes_left; in gluebi_read() local 160 lnum = div_u64_rem(from, mtd->erasesize, &offs); in gluebi_read() 172 lnum += 1; in gluebi_read() 196 int err = 0, lnum, offs, bytes_left; in gluebi_write() local 200 lnum = div_u64_rem(to, mtd->erasesize, &offs); in gluebi_write() 216 lnum += 1; in gluebi_write() 236 int err, i, lnum, count; in gluebi_erase() local 242 lnum = mtd_div_by_eb(instr->addr, mtd); in gluebi_erase() 247 err = ubi_leb_unmap(gluebi->desc, lnum + i); in gluebi_erase() 258 err = ubi_leb_erase(gluebi->desc, lnum + i); in gluebi_erase() [all …]
|
A D | upd.c | 174 vol->vol_id, req->lnum, req->bytes); in ubi_start_leb_change() 176 return ubi_eba_atomic_leb_change(ubi, vol, req->lnum, NULL, 0); in ubi_start_leb_change() 181 vol->ch_lnum = req->lnum; in ubi_start_leb_change() 234 err = ubi_eba_write_leb(ubi, vol, lnum, buf, 0, len); in write_leb() 246 err = ubi_eba_write_leb_st(ubi, vol, lnum, buf, len, used_ebs); in write_leb() 268 int lnum, offs, err = 0, len, to_write = count; in ubi_more_update_data() local 276 lnum = div_u64_rem(vol->upd_received, vol->usable_leb_size, &offs); in ubi_more_update_data() 309 err = write_leb(ubi, vol, lnum, vol->upd_buf, flush_len, in ubi_more_update_data() 318 lnum += 1; in ubi_more_update_data() 337 err = write_leb(ubi, vol, lnum, vol->upd_buf, in ubi_more_update_data() [all …]
|
A D | attach.c | 249 aeb->lnum = lnum; in add_to_list() 573 lnum = be32_to_cpu(vid_hdr->lnum); in ubi_add_to_av() 596 if (lnum != aeb->lnum) { in ubi_add_to_av() 597 if (lnum < aeb->lnum) in ubi_add_to_av() 659 aeb->lnum = lnum; in ubi_add_to_av() 693 aeb->lnum = lnum; in ubi_add_to_av() 1135 int lnum = be32_to_cpu(vidh->lnum); in scan_peb() local 1141 vol_id, lnum); in scan_peb() 1151 vol_id, lnum); in scan_peb() 1157 vol_id, lnum); in scan_peb() [all …]
|
/linux/fs/ubifs/ |
A D | log.c | 39 if (lnum < bud->lnum) in ubifs_search_bud() 41 else if (lnum > bud->lnum) in ubifs_search_bud() 72 if (lnum < bud->lnum) in ubifs_get_wbuf() 74 else if (lnum > bud->lnum) in ubifs_get_wbuf() 124 if (bud->lnum < b->lnum) in ubifs_add_bud() 224 bud->lnum = lnum; in ubifs_add_bud_to_log() 314 if (wbuf->lnum == bud->lnum) { in remove_buds() 404 ref->lnum = cpu_to_le32(lnum); in ubifs_log_start_commit() 569 if (lnum < dr->lnum) in done_already() 571 else if (lnum > dr->lnum) in done_already() [all …]
|
A D | lpt_commit.c | 132 lnum, c->ltab[lnum - c->lpt_first].free, in upd_ltab() 134 ubifs_assert(c, lnum >= c->lpt_first && lnum <= c->lpt_last); in upd_ltab() 193 lnum = c->nhead_lnum; in layout_cnodes() 208 c->ltab_lnum = lnum; in layout_cnodes() 252 cnode->parent->nbranch[cnode->iip].lnum = lnum; in layout_cnodes() 872 if (branch->lnum != lnum || branch->offs != offs) in make_nnode_dirty() 919 if (branch->lnum != lnum || branch->offs != offs) in make_pnode_dirty() 1166 if (lnum == -1) in lpt_gc() 1489 if (branch->lnum != lnum || branch->offs != offs) in dbg_is_nnode_dirty() 1525 if (branch->lnum != lnum || branch->offs != offs) in dbg_is_pnode_dirty() [all …]
|
A D | tnc_commit.c | 41 br->lnum = cpu_to_le32(zbr->lnum); in make_idx_node() 57 znode->lnum = lnum; in make_idx_node() 69 zbr->lnum = lnum; in make_idx_node() 74 c->zroot.lnum = lnum; in make_idx_node() 171 if (lnum < o->lnum) in find_old_idx() 173 else if (lnum > o->lnum) in find_old_idx() 471 znode->lnum = lnum; in layout_in_empty_space() 483 zbr->lnum = lnum; in layout_in_empty_space() 487 c->zroot.lnum = lnum; in layout_in_empty_space() 874 br->lnum = cpu_to_le32(zbr->lnum); in write_index() [all …]
|
A D | find.c | 30 int lnum; member 109 data->lnum = lprops->lnum; in scan_for_dirty_cb() 179 ubifs_assert(c, lprops->lnum == data.lnum); in scan_for_dirty() 380 data->lnum = lprops->lnum; in scan_for_free_cb() 458 ubifs_assert(c, lprops->lnum == data.lnum); in do_find_free_space() 534 lnum = lprops->lnum; in ubifs_find_free_space() 613 data->lnum = lprops->lnum; in scan_for_idx_cb() 638 ubifs_assert(c, lprops->lnum == data.lnum); in scan_for_leb_for_idx() 696 lnum = lprops->lnum; in ubifs_find_free_leb_for_idx() 802 data->lnum = lprops->lnum; in scan_dirty_idx_cb() [all …]
|
A D | recovery.c | 459 int lnum, int offs) in no_more_nodes() argument 494 int lnum = sleb->lnum, endpt = start; in fix_unclean_leb() local 514 ucleb->lnum = lnum; in fix_unclean_leb() 639 lnum, offs, len); in ubifs_recover_leb() 891 lnum); in ubifs_recover_log_leb() 985 int err, lnum = ucleb->lnum, offs = 0, len = ucleb->endpt, quiet = 1; in clean_an_unclean_leb() local 1029 lnum, offs); in clean_an_unclean_leb() 1103 int lnum, err; in grab_empty_leb() local 1121 if (lnum < 0) { in grab_empty_leb() 1125 return lnum; in grab_empty_leb() [all …]
|
A D | scan.c | 77 dbg_ntype(ch->node_type), lnum, offs); in ubifs_scan_a_node() 92 lnum, offs); in ubifs_scan_a_node() 131 dbg_scan("scan LEB %d:%d", lnum, offs); in ubifs_start_scan() 137 sleb->lnum = lnum; in ubifs_start_scan() 144 c->leb_size - offs, lnum, offs, err); in ubifs_start_scan() 164 int lnum, int offs) in ubifs_end_scan() argument 261 sleb = ubifs_start_scan(c, lnum, offs, sbuf); in ubifs_scan() 270 lnum, offs, len); in ubifs_scan() 320 ubifs_end_scan(c, sleb, lnum, offs); in ubifs_scan() 329 lnum, offs); in ubifs_scan() [all …]
|
A D | io.c | 139 len, lnum, err); in ubifs_leb_change() 191 lnum, err); in ubifs_is_mapped() 233 ubifs_assert(c, lnum >= 0 && lnum < c->leb_cnt && offs >= 0); in ubifs_check_node() 617 ubifs_assert(c, lnum >= 0 && lnum < c->leb_cnt); in ubifs_wbuf_seek_nolock() 620 ubifs_assert(c, lnum != wbuf->lnum); in ubifs_wbuf_seek_nolock() 624 wbuf->lnum = lnum; in ubifs_wbuf_seek_nolock() 727 ubifs_assert(c, len > 0 && wbuf->lnum >= 0 && wbuf->lnum < c->leb_cnt); in ubifs_wbuf_write_nolock() 918 ubifs_assert(c, lnum >= 0 && lnum < c->leb_cnt && offs >= 0); in ubifs_write_node_hmac() 981 ubifs_assert(c, wbuf && lnum >= 0 && lnum < c->leb_cnt && offs >= 0); in ubifs_read_node_wbuf() 986 overlap = (lnum == wbuf->lnum && offs + len > wbuf->offs); in ubifs_read_node_wbuf() [all …]
|
A D | replay.c | 46 int lnum; member 401 r->lnum = lnum; in insert_node() 456 r->lnum = lnum; in insert_dent() 669 int err = 0, used = 0, lnum = b->bud->lnum, offs = b->bud->start; in replay_bud() local 908 bud->lnum = lnum; in add_replay_bud() 945 int lnum = le32_to_cpu(ref->lnum); in validate_ref() local 1021 lnum, offs); in replay_log_leb() 1026 lnum, offs, in replay_log_leb() 1179 int err, lnum, free; in ubifs_replay_journal() local 1213 lnum, 0); in ubifs_replay_journal() [all …]
|
A D | gc.c | 496 int err = 0, lnum = lp->lnum; in ubifs_garbage_collect_leb() local 501 ubifs_assert(c, wbuf->lnum != lnum); in ubifs_garbage_collect_leb() 527 c->gc_lnum = lnum; in ubifs_garbage_collect_leb() 568 idx_gc->lnum = lnum; in ubifs_garbage_collect_leb() 606 c->gc_lnum = lnum; in ubifs_garbage_collect_leb() 627 c->gced_lnum = lnum; in ubifs_garbage_collect_leb() 766 ret = lp.lnum; in ubifs_garbage_collect() 921 idx_gc->lnum = lp->lnum; in ubifs_gc_start_commit() 992 int lnum; in ubifs_get_idx_gc_leb() local 997 lnum = idx_gc->lnum; in ubifs_get_idx_gc_leb() [all …]
|
A D | tnc.c | 78 old_idx->lnum = lnum; in insert_old_idx() 85 if (lnum < o->lnum) in insert_old_idx() 87 else if (lnum > o->lnum) in insert_old_idx() 444 int lnum = zbr->lnum; in try_read_node() local 1459 *lnum = zt->lnum; in ubifs_tnc_locate() 1563 lnum = zbr->lnum; in ubifs_tnc_get_bu_keys() 2286 zbr.lnum = lnum; in ubifs_tnc_add() 2297 zbr->lnum = lnum; in ubifs_tnc_add() 2348 zbr->lnum = lnum; in ubifs_tnc_replace() 2449 zbr->lnum = lnum; in ubifs_tnc_add_nm() [all …]
|
A D | lpt.c | 384 int lnum = nnode->nbranch[i].lnum; in ubifs_pack_nnode() local 472 lnum, c->ltab[lnum - c->lpt_first].free, in set_ltab() 885 int lnum = pnode->lprops[i].lnum; in update_cats() local 1029 nnode->nbranch[i].lnum = lnum; in ubifs_unpack_nnode() 1123 int lnum = nnode->nbranch[i].lnum; in validate_nnode() local 1191 pnode->lprops[i].lnum = lnum++; in set_pnode_lnum() 1212 lnum = branch->lnum; in ubifs_read_nnode() 1279 lnum = branch->lnum; in read_pnode() 2133 int ret, lnum = lprops->lnum; in ubifs_lpt_scan_nolock() local 2270 if (lprops->lnum != lnum) { in dbg_chk_pnode() [all …]
|
A D | journal.c | 127 if (lnum >= 0) in reserve_space() 130 err = lnum; in reserve_space() 143 if (lnum < 0) { in reserve_space() 144 err = lnum; in reserve_space() 176 lnum, wbuf->lnum, wbuf->offs + wbuf->used); in reserve_space() 276 *lnum = c->jheads[jhead].wbuf.lnum; in write_head() 647 ubifs_add_auth_dirt(c, lnum); in ubifs_jnl_update() 806 ubifs_add_auth_dirt(c, lnum); in ubifs_jnl_write_data() 843 int err, lnum, offs; in ubifs_jnl_write_inode() local 1154 ubifs_add_auth_dirt(c, lnum); in ubifs_jnl_xrename() [all …]
|
A D | ubifs.h | 279 int lnum; member 320 int lnum; member 339 int lnum; member 436 int lnum; member 482 int lnum; member 589 int lnum; member 686 int lnum; member 712 int lnum; member 751 int lnum; member 788 int lnum; member [all …]
|
A D | debug.c | 747 if (bud->lnum == lp->lnum) { in ubifs_dump_lprop() 756 lp->lnum == c->jheads[i].wbuf.lnum) { in ubifs_dump_lprop() 766 if (lp->lnum == c->gc_lnum) in ubifs_dump_lprop() 773 int lnum, err; in ubifs_dump_lprops() local 781 for (lnum = c->main_first; lnum < c->leb_cnt; lnum++) { in ubifs_dump_lprops() 2516 } else if (lnum == UBIFS_MST_LNUM || lnum == UBIFS_MST_LNUM + 1) { in power_cut_emulated() 2520 } else if (lnum >= UBIFS_LOG_LNUM && lnum <= c->log_last) { in power_cut_emulated() 2526 } else if (lnum >= c->lpt_first && lnum <= c->lpt_last) { in power_cut_emulated() 2532 } else if (lnum >= c->orph_first && lnum <= c->orph_last) { in power_cut_emulated() 2542 } else if (c->jheads && lnum == c->jheads[GCHD].wbuf.lnum) { in power_cut_emulated() [all …]
|
A D | misc.h | 161 static inline int ubifs_add_dirt(struct ubifs_info *c, int lnum, int dirty) in ubifs_add_dirt() argument 163 return ubifs_update_one_lp(c, lnum, LPROPS_NC, dirty, 0, 0); in ubifs_add_dirt() 175 static inline int ubifs_return_leb(struct ubifs_info *c, int lnum) in ubifs_return_leb() argument 177 return ubifs_change_one_lp(c, lnum, LPROPS_NC, LPROPS_NC, 0, in ubifs_return_leb() 270 static inline int ubifs_next_log_lnum(const struct ubifs_info *c, int lnum) in ubifs_next_log_lnum() argument 272 lnum += 1; in ubifs_next_log_lnum() 273 if (lnum > c->log_last) in ubifs_next_log_lnum() 274 lnum = UBIFS_LOG_LNUM; in ubifs_next_log_lnum() 276 return lnum; in ubifs_next_log_lnum()
|
A D | sb.c | 805 return ubifs_leb_unmap(c, lnum); in fixup_leb() 825 int lnum, err = 0; in fixup_free_space() local 831 for (lnum = UBIFS_MST_LNUM; lnum < UBIFS_LOG_LNUM; lnum++) { in fixup_free_space() 839 while (lnum != c->ltail_lnum) { in fixup_free_space() 840 err = fixup_leb(c, lnum, 0); in fixup_free_space() 843 lnum = ubifs_next_log_lnum(c, lnum); in fixup_free_space() 856 for (lnum = c->lpt_first; lnum <= c->lpt_last; lnum++) { in fixup_free_space() 867 for (lnum = c->orph_first; lnum <= c->orph_last; lnum++) { in fixup_free_space() 868 err = fixup_leb(c, lnum, 0); in fixup_free_space() 874 for (lnum = c->main_first; lnum < c->leb_cnt; lnum++) { in fixup_free_space() [all …]
|
A D | tnc_misc.c | 268 int lnum = zzbr->lnum; in read_znode() local 286 ubifs_bad_hash(c, idx, zzbr->hash, lnum, offs); in read_znode() 295 lnum, offs, znode->level, znode->child_cnt); in read_znode() 311 zbr->lnum = le32_to_cpu(br->lnum); in read_znode() 319 if (zbr->lnum < c->main_first || in read_znode() 320 zbr->lnum >= c->leb_cnt || zbr->offs < 0 || in read_znode() 471 wbuf = ubifs_get_wbuf(c, zbr->lnum); in ubifs_tnc_read_node() 474 zbr->lnum, zbr->offs); in ubifs_tnc_read_node() 476 err = ubifs_read_node(c, node, type, zbr->len, zbr->lnum, in ubifs_tnc_read_node() 488 zbr->lnum, zbr->offs); in ubifs_tnc_read_node() [all …]
|
A D | lprops.c | 672 lnum, err); in ubifs_change_one_lp() 711 lnum, err); in ubifs_update_one_lp() 736 lnum, err); in ubifs_read_one_lp() 979 lp->lnum); in dbg_check_heap() 989 if (lp->lnum == lprops->lnum) { in dbg_check_heap() 1021 int cat, lnum = lp->lnum, is_idx = 0, used = 0, free, dirty, ret; in scan_check_cb() local 1073 if ((lp->hpos != -1 && heap->arr[lp->hpos]->lnum != lnum) || in scan_check_cb() 1123 lnum, snod->offs); in scan_check_cb() 1149 lnum, free, dirty); in scan_check_cb() 1171 lnum != c->ihead_lnum) { in scan_check_cb() [all …]
|
A D | orphan.c | 416 int lnum; in write_orph_nodes() local 419 for (lnum = c->ohead_lnum + 1; lnum <= c->orph_last; lnum++) { in write_orph_nodes() 420 err = ubifs_leb_unmap(c, lnum); in write_orph_nodes() 561 int lnum, err; in ubifs_clear_orphans() local 563 for (lnum = c->orph_first; lnum <= c->orph_last; lnum++) { in ubifs_clear_orphans() 564 err = ubifs_leb_unmap(c, lnum); in ubifs_clear_orphans() 777 for (lnum = c->orph_first; lnum <= c->orph_last; lnum++) { in kill_orphans() 780 dbg_rcvry("LEB %d", lnum); in kill_orphans() 798 c->ohead_lnum = lnum; in kill_orphans() 977 int lnum, err = 0; in dbg_scan_orphans() local [all …]
|
/linux/include/linux/mtd/ |
A D | ubi.h | 241 int ubi_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf, 243 int ubi_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf, 245 int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum); 246 int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum); 247 int ubi_leb_map(struct ubi_volume_desc *desc, int lnum); 248 int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum); 250 int ubi_flush(int ubi_num, int vol_id, int lnum); 256 static inline int ubi_read(struct ubi_volume_desc *desc, int lnum, char *buf, in ubi_read() argument 259 return ubi_leb_read(desc, lnum, buf, offset, len, 0); in ubi_read() 266 static inline int ubi_read_sg(struct ubi_volume_desc *desc, int lnum, in ubi_read_sg() argument [all …]
|