Lines Matching refs:lnum

384 		int lnum = nnode->nbranch[i].lnum;  in ubifs_pack_nnode()  local
386 if (lnum == 0) in ubifs_pack_nnode()
387 lnum = c->lpt_last + 1; in ubifs_pack_nnode()
388 pack_bits(c, &addr, &pos, lnum - c->lpt_first, c->lpt_lnum_bits); in ubifs_pack_nnode()
452 void ubifs_add_lpt_dirt(struct ubifs_info *c, int lnum, int dirty) in ubifs_add_lpt_dirt() argument
454 if (!dirty || !lnum) in ubifs_add_lpt_dirt()
457 lnum, dirty, c->ltab[lnum - c->lpt_first].dirty); in ubifs_add_lpt_dirt()
458 ubifs_assert(c, lnum >= c->lpt_first && lnum <= c->lpt_last); in ubifs_add_lpt_dirt()
459 c->ltab[lnum - c->lpt_first].dirty += dirty; in ubifs_add_lpt_dirt()
469 static void set_ltab(struct ubifs_info *c, int lnum, int free, int dirty) in set_ltab() argument
472 lnum, c->ltab[lnum - c->lpt_first].free, in set_ltab()
473 c->ltab[lnum - c->lpt_first].dirty, free, dirty); in set_ltab()
474 ubifs_assert(c, lnum >= c->lpt_first && lnum <= c->lpt_last); in set_ltab()
475 c->ltab[lnum - c->lpt_first].free = free; in set_ltab()
476 c->ltab[lnum - c->lpt_first].dirty = dirty; in set_ltab()
489 ubifs_add_lpt_dirt(c, np->nbranch[nnode->iip].lnum, in ubifs_add_nnode_dirt()
507 ubifs_add_lpt_dirt(c, pnode->parent->nbranch[pnode->iip].lnum, in add_pnode_dirt()
602 int lnum, err = 0, node_sz, iopos, i, j, cnt, len, alen, row; in ubifs_create_dflt_lpt() local
649 lnum = lpt_first; in ubifs_create_dflt_lpt()
694 blnum = lnum; /* LEB number of level below */ in ubifs_create_dflt_lpt()
703 set_ltab(c, lnum, c->leb_size - alen, alen - len); in ubifs_create_dflt_lpt()
705 err = ubifs_leb_change(c, lnum++, buf, alen); in ubifs_create_dflt_lpt()
736 set_ltab(c, lnum, c->leb_size - alen, in ubifs_create_dflt_lpt()
739 err = ubifs_leb_change(c, lnum++, buf, alen); in ubifs_create_dflt_lpt()
747 c->lpt_lnum = lnum; in ubifs_create_dflt_lpt()
757 nnode->nbranch[j].lnum = blnum; in ubifs_create_dflt_lpt()
762 nnode->nbranch[j].lnum = 0; in ubifs_create_dflt_lpt()
784 set_ltab(c, lnum, c->leb_size - alen, alen - len); in ubifs_create_dflt_lpt()
786 err = ubifs_leb_change(c, lnum++, buf, alen); in ubifs_create_dflt_lpt()
793 c->lsave_lnum = lnum; in ubifs_create_dflt_lpt()
809 set_ltab(c, lnum, c->leb_size - alen, alen - len); in ubifs_create_dflt_lpt()
811 err = ubifs_leb_change(c, lnum++, buf, alen); in ubifs_create_dflt_lpt()
818 c->ltab_lnum = lnum; in ubifs_create_dflt_lpt()
824 set_ltab(c, lnum, c->leb_size - alen, alen - len); in ubifs_create_dflt_lpt()
831 err = ubifs_leb_change(c, lnum, buf, alen); in ubifs_create_dflt_lpt()
839 c->nhead_lnum = lnum; in ubifs_create_dflt_lpt()
885 int lnum = pnode->lprops[i].lnum; in update_cats() local
887 if (!lnum) in update_cats()
909 if (!new_pnode->lprops[i].lnum) in replace_cats()
1023 int lnum; in ubifs_unpack_nnode() local
1025 lnum = ubifs_unpack_bits(c, &addr, &pos, c->lpt_lnum_bits) + in ubifs_unpack_nnode()
1027 if (lnum == c->lpt_last + 1) in ubifs_unpack_nnode()
1028 lnum = 0; in ubifs_unpack_nnode()
1029 nnode->nbranch[i].lnum = lnum; in ubifs_unpack_nnode()
1085 int lnum = ubifs_unpack_bits(c, &addr, &pos, c->lnum_bits); in unpack_lsave() local
1087 if (lnum < c->main_first || lnum >= c->leb_cnt) in unpack_lsave()
1089 c->lsave[i] = lnum; in unpack_lsave()
1123 int lnum = nnode->nbranch[i].lnum; in validate_nnode() local
1126 if (lnum == 0) { in validate_nnode()
1131 if (lnum < c->lpt_first || lnum > c->lpt_last) in validate_nnode()
1185 int i, lnum; in set_pnode_lnum() local
1187 lnum = (pnode->num << UBIFS_LPT_FANOUT_SHIFT) + c->main_first; in set_pnode_lnum()
1189 if (lnum >= c->leb_cnt) in set_pnode_lnum()
1191 pnode->lprops[i].lnum = lnum++; in set_pnode_lnum()
1208 int err, lnum, offs; in ubifs_read_nnode() local
1212 lnum = branch->lnum; in ubifs_read_nnode()
1215 lnum = c->lpt_lnum; in ubifs_read_nnode()
1223 if (lnum == 0) { in ubifs_read_nnode()
1233 err = ubifs_leb_read(c, lnum, buf, offs, c->nnode_sz, 1); in ubifs_read_nnode()
1257 ubifs_err(c, "error %d reading nnode at %d:%d", err, lnum, offs); in ubifs_read_nnode()
1276 int err, lnum, offs; in read_pnode() local
1279 lnum = branch->lnum; in read_pnode()
1285 if (lnum == 0) { in read_pnode()
1302 err = ubifs_leb_read(c, lnum, buf, offs, c->pnode_sz, 1); in read_pnode()
1322 ubifs_err(c, "error %d reading pnode at %d:%d", err, lnum, offs); in read_pnode()
1375 int lnum = c->lsave[i]; in read_lsave() local
1382 if (lnum >= c->leb_cnt) in read_lsave()
1384 lprops = ubifs_lpt_lookup(c, lnum); in read_lsave()
1488 struct ubifs_lprops *ubifs_lpt_lookup(struct ubifs_info *c, int lnum) in ubifs_lpt_lookup() argument
1493 i = lnum - c->main_first; in ubifs_lpt_lookup()
1498 dbg_lp("LEB %d, free %d, dirty %d, flags %d", lnum, in ubifs_lpt_lookup()
1603 struct ubifs_lprops *ubifs_lpt_lookup_dirty(struct ubifs_info *c, int lnum) in ubifs_lpt_lookup_dirty() argument
1618 i = lnum - c->main_first; in ubifs_lpt_lookup_dirty()
1638 dbg_lp("LEB %d, free %d, dirty %d, flags %d", lnum, in ubifs_lpt_lookup_dirty()
1689 if (nn->nbranch[iip].lnum == 0) { in ubifs_lpt_calc_hash()
1712 if (nn->nbranch[i].lnum == 0) in ubifs_lpt_calc_hash()
1970 if (branch->lnum == 0) { in scan_get_nnode()
1980 err = ubifs_leb_read(c, branch->lnum, buf, branch->offs, in scan_get_nnode()
2029 if (branch->lnum == 0) { in scan_get_pnode()
2046 ubifs_assert(c, branch->lnum >= c->lpt_first && in scan_get_pnode()
2047 branch->lnum <= c->lpt_last); in scan_get_pnode()
2049 err = ubifs_leb_read(c, branch->lnum, buf, branch->offs, in scan_get_pnode()
2133 int ret, lnum = lprops->lnum; in ubifs_lpt_scan_nolock() local
2190 if (lnum == end_lnum) { in ubifs_lpt_scan_nolock()
2198 if (lnum + 1 >= c->leb_cnt) { in ubifs_lpt_scan_nolock()
2262 int lnum = (pnode->num << UBIFS_LPT_FANOUT_SHIFT) + i + in dbg_chk_pnode() local
2268 if (lnum >= c->leb_cnt) in dbg_chk_pnode()
2270 if (lprops->lnum != lnum) { in dbg_chk_pnode()
2272 lprops->lnum, lnum); in dbg_chk_pnode()
2278 lprops->lnum, cat); in dbg_chk_pnode()
2291 lprops->lnum, cat); in dbg_chk_pnode()
2304 lprops->lnum, cat); in dbg_chk_pnode()
2345 lprops->lnum, cat); in dbg_chk_pnode()
2352 lprops->lnum, cat, lprops->free, in dbg_chk_pnode()
2361 lprops->lnum, cat, lprops->free, in dbg_chk_pnode()