Lines Matching refs:lnum
70 static int insert_old_idx(struct ubifs_info *c, int lnum, int offs) in insert_old_idx() argument
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()
118 return insert_old_idx(c, zbr->lnum, zbr->offs); in insert_old_idx_znode()
121 return insert_old_idx(c, c->zroot.lnum, in insert_old_idx_znode()
143 err = insert_old_idx(c, zbr->lnum, zbr->offs); in ins_clr_old_idx_znode()
146 zbr->lnum = 0; in ins_clr_old_idx_znode()
152 err = insert_old_idx(c, c->zroot.lnum, c->zroot.offs); in ins_clr_old_idx_znode()
155 c->zroot.lnum = 0; in ins_clr_old_idx_znode()
230 static int add_idx_dirt(struct ubifs_info *c, int lnum, int dirt) in add_idx_dirt() argument
233 return ubifs_add_dirt(c, lnum, dirt); in add_idx_dirt()
256 err = add_idx_dirt(c, zbr->lnum, zbr->len); in dirty_cow_znode()
268 err = insert_old_idx(c, zbr->lnum, zbr->offs); in dirty_cow_znode()
271 err = add_idx_dirt(c, zbr->lnum, zbr->len); in dirty_cow_znode()
276 zbr->lnum = 0; in dirty_cow_znode()
444 int lnum = zbr->lnum; in try_read_node() local
450 dbg_io("LEB %d:%d, %s, length %d", lnum, offs, dbg_ntype(type), len); in try_read_node()
452 err = ubifs_leb_read(c, lnum, buf, offs, len, 1); in try_read_node()
455 type, lnum, offs, err); in try_read_node()
479 ubifs_bad_hash(c, buf, zbr->hash, lnum, offs); in try_read_node()
501 dbg_tnck(key, "LEB %d:%d, key ", zbr->lnum, zbr->offs); in fallible_read_node()
515 zbr->lnum, zbr->offs, zbr->len); in fallible_read_node()
992 o_znode->zbranch[o_n].lnum, o_znode->zbranch[o_n].offs, in fallible_resolve_collision()
1007 static int matches_position(struct ubifs_zbranch *zbr, int lnum, int offs) in matches_position() argument
1009 if (zbr->lnum == lnum && zbr->offs == offs) in matches_position()
1035 int lnum, int offs) in resolve_collision_directly() argument
1042 if (matches_position(&znode->zbranch[nn], lnum, offs)) in resolve_collision_directly()
1054 if (matches_position(&znode->zbranch[nn], lnum, offs)) { in resolve_collision_directly()
1074 if (matches_position(&znode->zbranch[nn], lnum, offs)) in resolve_collision_directly()
1401 static int maybe_leb_gced(struct ubifs_info *c, int lnum, int gc_seq1) in maybe_leb_gced() argument
1422 if (gced_lnum == lnum) in maybe_leb_gced()
1441 void *node, int *lnum, int *offs) in ubifs_tnc_locate() argument
1458 if (lnum) { in ubifs_tnc_locate()
1459 *lnum = zt->lnum; in ubifs_tnc_locate()
1479 if (ubifs_get_wbuf(c, zbr.lnum)) { in ubifs_tnc_locate()
1486 if (err <= 0 || maybe_leb_gced(c, zbr.lnum, gc_seq1)) { in ubifs_tnc_locate()
1516 int n, err = 0, lnum = -1, offs; in ubifs_tnc_get_bu_keys() local
1541 lnum = znode->zbranch[n].lnum; in ubifs_tnc_get_bu_keys()
1561 if (lnum < 0) { in ubifs_tnc_get_bu_keys()
1563 lnum = zbr->lnum; in ubifs_tnc_get_bu_keys()
1575 if (zbr->lnum != lnum || zbr->offs != offs) in ubifs_tnc_get_bu_keys()
1646 static int read_wbuf(struct ubifs_wbuf *wbuf, void *buf, int len, int lnum, in read_wbuf() argument
1652 dbg_io("LEB %d:%d, length %d", lnum, offs, len); in read_wbuf()
1653 ubifs_assert(c, wbuf && lnum >= 0 && lnum < c->leb_cnt && offs >= 0); in read_wbuf()
1658 overlap = (lnum == wbuf->lnum && offs + len > wbuf->offs); in read_wbuf()
1662 return ubifs_leb_read(c, lnum, buf, offs, len, 0); in read_wbuf()
1676 return ubifs_leb_read(c, lnum, buf, offs, rlen, 0); in read_wbuf()
1702 err = ubifs_check_node(c, buf, zbr->len, zbr->lnum, zbr->offs, 0, 0); in validate_data_node()
1710 ubifs_bad_hash(c, buf, zbr->hash, zbr->lnum, zbr->offs); in validate_data_node()
1724 zbr->lnum, zbr->offs); in validate_data_node()
1735 ubifs_err(c, "bad node at LEB %d:%d", zbr->lnum, zbr->offs); in validate_data_node()
1753 int lnum = bu->zbranch[0].lnum, offs = bu->zbranch[0].offs, len, err, i; in ubifs_tnc_bulk_read() local
1765 wbuf = ubifs_get_wbuf(c, lnum); in ubifs_tnc_bulk_read()
1767 err = read_wbuf(wbuf, bu->buf, len, lnum, offs); in ubifs_tnc_bulk_read()
1769 err = ubifs_leb_read(c, lnum, bu->buf, offs, len, 0); in ubifs_tnc_bulk_read()
1772 if (maybe_leb_gced(c, lnum, bu->gc_seq)) in ubifs_tnc_bulk_read()
1777 lnum, offs, err); in ubifs_tnc_bulk_read()
2218 zbr->lnum = 0; in tnc_insert()
2241 zi->zbranch[0].lnum = c->zroot.lnum; in tnc_insert()
2247 c->zroot.lnum = 0; in tnc_insert()
2273 int ubifs_tnc_add(struct ubifs_info *c, const union ubifs_key *key, int lnum, in ubifs_tnc_add() argument
2280 dbg_tnck(key, "%d:%d, len %d, key ", lnum, offs, len); in ubifs_tnc_add()
2286 zbr.lnum = lnum; in ubifs_tnc_add()
2296 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_add()
2297 zbr->lnum = lnum; in ubifs_tnc_add()
2325 int old_lnum, int old_offs, int lnum, int offs, int len) in ubifs_tnc_replace() argument
2332 old_offs, lnum, offs, len); in ubifs_tnc_replace()
2343 if (zbr->lnum == old_lnum && zbr->offs == old_offs) { in ubifs_tnc_replace()
2345 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_replace()
2348 zbr->lnum = lnum; in ubifs_tnc_replace()
2373 err = ubifs_add_dirt(c, zbr->lnum, in ubifs_tnc_replace()
2377 zbr->lnum = lnum; in ubifs_tnc_replace()
2385 err = ubifs_add_dirt(c, lnum, len); in ubifs_tnc_replace()
2409 int lnum, int offs, int len, const u8 *hash, in ubifs_tnc_add_nm() argument
2416 dbg_tnck(key, "LEB %d:%d, key ", lnum, offs); in ubifs_tnc_add_nm()
2448 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_add_nm()
2449 zbr->lnum = lnum; in ubifs_tnc_add_nm()
2461 zbr.lnum = lnum; in ubifs_tnc_add_nm()
2516 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in tnc_delete()
2583 err = insert_old_idx(c, c->zroot.lnum, in tnc_delete()
2588 c->zroot.lnum = zbr->lnum; in tnc_delete()
2829 err = ubifs_add_dirt(c, znode->zbranch[i].lnum, in ubifs_tnc_remove_range()
3179 int lnum, int offs) in lookup_znode() argument
3201 if (c->zroot.lnum == lnum && c->zroot.offs == offs) in lookup_znode()
3232 if (znode->zbranch[n].lnum == lnum && znode->zbranch[n].offs == offs) in lookup_znode()
3257 if (znode->zbranch[n].lnum == lnum && in lookup_znode()
3279 if (znode->zbranch[n].lnum == lnum && in lookup_znode()
3307 int lnum, int offs) in is_idx_node_in_tnc() argument
3311 znode = lookup_znode(c, key, level, lnum, offs); in is_idx_node_in_tnc()
3334 int lnum, int offs) in is_leaf_node_in_tnc() argument
3347 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()
3367 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()
3383 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()
3404 int lnum, int offs, int is_idx) in ubifs_tnc_has_node() argument
3410 err = is_idx_node_in_tnc(c, key, level, lnum, offs); in ubifs_tnc_has_node()
3422 err = is_leaf_node_in_tnc(c, key, lnum, offs); in ubifs_tnc_has_node()
3444 int lnum, int offs) in ubifs_dirty_idx_node() argument
3450 znode = lookup_znode(c, key, level, lnum, offs); in ubifs_dirty_idx_node()