Lines Matching refs:offs
61 else if (old_idx->offs < o->offs) in do_insert_old_idx()
63 else if (old_idx->offs > o->offs) in do_insert_old_idx()
98 static int insert_old_idx(struct ubifs_info *c, int lnum, int offs) in insert_old_idx() argument
106 old_idx->offs = offs; in insert_old_idx()
126 return insert_old_idx(c, zbr->lnum, zbr->offs); in insert_old_idx_znode()
130 c->zroot.offs); in insert_old_idx_znode()
151 err = insert_old_idx(c, zbr->lnum, zbr->offs); in ins_clr_old_idx_znode()
155 zbr->offs = 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()
164 c->zroot.offs = 0; in ins_clr_old_idx_znode()
257 zbr->offs = 0; in replace_znode()
303 old_idx->offs = zbr->offs; in dirty_cow_znode()
483 int offs = zbr->offs; 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()
1479 void *node, int *lnum, int *offs) in ubifs_tnc_locate() argument
1498 *offs = zt->offs; in ubifs_tnc_locate()
1554 int n, err = 0, lnum = -1, offs; in ubifs_tnc_get_bu_keys() local
1580 offs = ALIGN(znode->zbranch[n].offs + len, 8); in ubifs_tnc_get_bu_keys()
1602 offs = ALIGN(zbr->offs + zbr->len, 8); in ubifs_tnc_get_bu_keys()
1613 if (zbr->lnum != lnum || zbr->offs != offs) in ubifs_tnc_get_bu_keys()
1615 offs += ALIGN(zbr->len, 8); in ubifs_tnc_get_bu_keys()
1685 int offs) 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()
1692 ubifs_assert(c, !(offs & 7) && offs < c->leb_size); in read_wbuf()
1693 ubifs_assert(c, offs + len <= c->leb_size); 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()
1704 rlen = wbuf->offs - offs; in read_wbuf()
1709 memcpy(buf + rlen, wbuf->buf + offs + rlen - wbuf->offs, len - rlen); 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
1795 len = bu->zbranch[bu->cnt - 1].offs; in ubifs_tnc_bulk_read()
1796 len += bu->zbranch[bu->cnt - 1].len - offs; 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()
1815 lnum, offs, err); in ubifs_tnc_bulk_read()
2257 zbr->offs = 0; in tnc_insert()
2280 zi->zbranch[0].offs = c->zroot.offs; in tnc_insert()
2286 c->zroot.offs = 0; in tnc_insert()
2312 int offs, int len, const u8 *hash) in ubifs_tnc_add() argument
2318 dbg_tnck(key, "%d:%d, len %d, key ", lnum, offs, len); in ubifs_tnc_add()
2325 zbr.offs = offs; in ubifs_tnc_add()
2336 zbr->offs = offs; 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()
2387 zbr->offs = offs; in ubifs_tnc_replace()
2416 zbr->offs = offs; 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()
2488 zbr->offs = offs; in ubifs_tnc_add_nm()
2500 zbr.offs = offs; in ubifs_tnc_add_nm()
2622 c->zroot.offs); in tnc_delete()
2627 c->zroot.offs = zbr->offs; in tnc_delete()
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()
3311 znode->zbranch[n].offs == offs) in lookup_znode()
3333 znode->zbranch[n].offs == offs) 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()