Lines Matching refs:lnum
57 if (old_idx->lnum < o->lnum) in do_insert_old_idx()
59 else if (old_idx->lnum > o->lnum) in do_insert_old_idx()
98 static int insert_old_idx(struct ubifs_info *c, int lnum, int offs) in insert_old_idx() argument
105 old_idx->lnum = lnum; in insert_old_idx()
126 return insert_old_idx(c, zbr->lnum, zbr->offs); in insert_old_idx_znode()
129 return insert_old_idx(c, c->zroot.lnum, in insert_old_idx_znode()
151 err = insert_old_idx(c, zbr->lnum, zbr->offs); in ins_clr_old_idx_znode()
154 zbr->lnum = 0; in ins_clr_old_idx_znode()
160 err = insert_old_idx(c, c->zroot.lnum, c->zroot.offs); in ins_clr_old_idx_znode()
163 c->zroot.lnum = 0; in ins_clr_old_idx_znode()
221 static int add_idx_dirt(struct ubifs_info *c, int lnum, int dirt) in add_idx_dirt() argument
224 return ubifs_add_dirt(c, lnum, dirt); in add_idx_dirt()
256 zbr->lnum = 0; in replace_znode()
283 err = add_idx_dirt(c, zbr->lnum, zbr->len); in dirty_cow_znode()
302 old_idx->lnum = zbr->lnum; in dirty_cow_znode()
305 err = add_idx_dirt(c, zbr->lnum, zbr->len); in dirty_cow_znode()
482 int lnum = zbr->lnum; in try_read_node() local
488 dbg_io("LEB %d:%d, %s, length %d", lnum, offs, dbg_ntype(type), len); in try_read_node()
490 err = ubifs_leb_read(c, lnum, buf, offs, len, 1); in try_read_node()
493 type, lnum, offs, err); in try_read_node()
517 ubifs_bad_hash(c, buf, zbr->hash, lnum, offs); in try_read_node()
539 dbg_tnck(key, "LEB %d:%d, key ", zbr->lnum, zbr->offs); in fallible_read_node()
553 zbr->lnum, zbr->offs, zbr->len); in fallible_read_node()
1030 o_znode->zbranch[o_n].lnum, o_znode->zbranch[o_n].offs, in fallible_resolve_collision()
1045 static int matches_position(struct ubifs_zbranch *zbr, int lnum, int offs) in matches_position() argument
1047 if (zbr->lnum == lnum && zbr->offs == offs) in matches_position()
1073 int lnum, int offs) in resolve_collision_directly() argument
1080 if (matches_position(&znode->zbranch[nn], lnum, offs)) in resolve_collision_directly()
1092 if (matches_position(&znode->zbranch[nn], lnum, offs)) { in resolve_collision_directly()
1112 if (matches_position(&znode->zbranch[nn], lnum, offs)) in resolve_collision_directly()
1439 static int maybe_leb_gced(struct ubifs_info *c, int lnum, int gc_seq1) in maybe_leb_gced() argument
1460 if (gced_lnum == lnum) in maybe_leb_gced()
1479 void *node, int *lnum, int *offs) in ubifs_tnc_locate() argument
1496 if (lnum) { in ubifs_tnc_locate()
1497 *lnum = zt->lnum; in ubifs_tnc_locate()
1517 if (ubifs_get_wbuf(c, zbr.lnum)) { in ubifs_tnc_locate()
1524 if (err <= 0 || maybe_leb_gced(c, zbr.lnum, gc_seq1)) { in ubifs_tnc_locate()
1554 int n, err = 0, lnum = -1, offs; in ubifs_tnc_get_bu_keys() local
1579 lnum = znode->zbranch[n].lnum; in ubifs_tnc_get_bu_keys()
1599 if (lnum < 0) { in ubifs_tnc_get_bu_keys()
1601 lnum = zbr->lnum; in ubifs_tnc_get_bu_keys()
1613 if (zbr->lnum != lnum || zbr->offs != offs) in ubifs_tnc_get_bu_keys()
1684 static int read_wbuf(struct ubifs_wbuf *wbuf, void *buf, int len, int lnum, in read_wbuf() argument
1690 dbg_io("LEB %d:%d, length %d", lnum, offs, len); in read_wbuf()
1691 ubifs_assert(c, wbuf && lnum >= 0 && lnum < c->leb_cnt && offs >= 0); in read_wbuf()
1696 overlap = (lnum == wbuf->lnum && offs + len > wbuf->offs); in read_wbuf()
1700 return ubifs_leb_read(c, lnum, buf, offs, len, 0); in read_wbuf()
1714 return ubifs_leb_read(c, lnum, buf, offs, rlen, 0); in read_wbuf()
1740 err = ubifs_check_node(c, buf, zbr->len, zbr->lnum, zbr->offs, 0, 0); in validate_data_node()
1748 ubifs_bad_hash(c, buf, zbr->hash, zbr->lnum, zbr->offs); in validate_data_node()
1762 zbr->lnum, zbr->offs); in validate_data_node()
1773 ubifs_err(c, "bad node at LEB %d:%d", zbr->lnum, zbr->offs); in validate_data_node()
1791 int lnum = bu->zbranch[0].lnum, offs = bu->zbranch[0].offs, len, err, i; in ubifs_tnc_bulk_read() local
1803 wbuf = ubifs_get_wbuf(c, lnum); in ubifs_tnc_bulk_read()
1805 err = read_wbuf(wbuf, bu->buf, len, lnum, offs); in ubifs_tnc_bulk_read()
1807 err = ubifs_leb_read(c, lnum, bu->buf, offs, len, 0); in ubifs_tnc_bulk_read()
1810 if (maybe_leb_gced(c, lnum, bu->gc_seq)) in ubifs_tnc_bulk_read()
1815 lnum, offs, err); in ubifs_tnc_bulk_read()
2256 zbr->lnum = 0; in tnc_insert()
2279 zi->zbranch[0].lnum = c->zroot.lnum; in tnc_insert()
2285 c->zroot.lnum = 0; in tnc_insert()
2311 int ubifs_tnc_add(struct ubifs_info *c, const union ubifs_key *key, int lnum, in ubifs_tnc_add() argument
2318 dbg_tnck(key, "%d:%d, len %d, key ", lnum, offs, len); in ubifs_tnc_add()
2324 zbr.lnum = lnum; in ubifs_tnc_add()
2334 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_add()
2335 zbr->lnum = lnum; in ubifs_tnc_add()
2363 int old_lnum, int old_offs, int lnum, int offs, int len) in ubifs_tnc_replace() argument
2370 old_offs, lnum, offs, len); in ubifs_tnc_replace()
2381 if (zbr->lnum == old_lnum && zbr->offs == old_offs) { in ubifs_tnc_replace()
2383 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_replace()
2386 zbr->lnum = lnum; in ubifs_tnc_replace()
2411 err = ubifs_add_dirt(c, zbr->lnum, in ubifs_tnc_replace()
2415 zbr->lnum = lnum; in ubifs_tnc_replace()
2423 err = ubifs_add_dirt(c, lnum, len); in ubifs_tnc_replace()
2447 int lnum, int offs, int len, const u8 *hash, in ubifs_tnc_add_nm() argument
2454 dbg_tnck(key, "LEB %d:%d, key ", lnum, offs); in ubifs_tnc_add_nm()
2486 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_add_nm()
2487 zbr->lnum = lnum; in ubifs_tnc_add_nm()
2499 zbr.lnum = lnum; in ubifs_tnc_add_nm()
2554 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in tnc_delete()
2621 err = insert_old_idx(c, c->zroot.lnum, in tnc_delete()
2626 c->zroot.lnum = zbr->lnum; in tnc_delete()
2867 err = ubifs_add_dirt(c, znode->zbranch[i].lnum, in ubifs_tnc_remove_range()
3232 int lnum, int offs) in lookup_znode() argument
3254 if (c->zroot.lnum == lnum && c->zroot.offs == offs) in lookup_znode()
3285 if (znode->zbranch[n].lnum == lnum && znode->zbranch[n].offs == offs) in lookup_znode()
3310 if (znode->zbranch[n].lnum == lnum && in lookup_znode()
3332 if (znode->zbranch[n].lnum == lnum && in lookup_znode()
3360 int lnum, int offs) in is_idx_node_in_tnc() argument
3364 znode = lookup_znode(c, key, level, lnum, offs); in is_idx_node_in_tnc()
3387 int lnum, int offs) in is_leaf_node_in_tnc() argument
3400 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()
3420 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()
3436 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()
3457 int lnum, int offs, int is_idx) in ubifs_tnc_has_node() argument
3463 err = is_idx_node_in_tnc(c, key, level, lnum, offs); in ubifs_tnc_has_node()
3475 err = is_leaf_node_in_tnc(c, key, lnum, offs); in ubifs_tnc_has_node()
3497 int lnum, int offs) in ubifs_dirty_idx_node() argument
3503 znode = lookup_znode(c, key, level, lnum, offs); in ubifs_dirty_idx_node()