• Home
  • Raw
  • Download

Lines Matching refs:zbr

121 		struct ubifs_zbranch *zbr;  in insert_old_idx_znode()  local
123 zbr = &znode->parent->zbranch[znode->iip]; in insert_old_idx_znode()
124 if (zbr->len) in insert_old_idx_znode()
125 return insert_old_idx(c, zbr->lnum, zbr->offs); in insert_old_idx_znode()
146 struct ubifs_zbranch *zbr; in ins_clr_old_idx_znode() local
148 zbr = &znode->parent->zbranch[znode->iip]; in ins_clr_old_idx_znode()
149 if (zbr->len) { in ins_clr_old_idx_znode()
150 err = insert_old_idx(c, zbr->lnum, zbr->offs); in ins_clr_old_idx_znode()
153 zbr->lnum = 0; in ins_clr_old_idx_znode()
154 zbr->offs = 0; in ins_clr_old_idx_znode()
155 zbr->len = 0; in ins_clr_old_idx_znode()
235 struct ubifs_zbranch *zbr = &zn->zbranch[i]; in copy_znode() local
237 if (zbr->znode) in copy_znode()
238 zbr->znode->parent = zn; in copy_znode()
268 struct ubifs_zbranch *zbr) in dirty_cow_znode() argument
270 struct ubifs_znode *znode = zbr->znode; in dirty_cow_znode()
280 err = add_idx_dirt(c, zbr->lnum, zbr->len); in dirty_cow_znode()
291 if (zbr->len) { in dirty_cow_znode()
292 err = insert_old_idx(c, zbr->lnum, zbr->offs); in dirty_cow_znode()
295 err = add_idx_dirt(c, zbr->lnum, zbr->len); in dirty_cow_znode()
299 zbr->znode = zn; in dirty_cow_znode()
300 zbr->lnum = 0; in dirty_cow_znode()
301 zbr->offs = 0; in dirty_cow_znode()
302 zbr->len = 0; in dirty_cow_znode()
329 static int lnc_add(struct ubifs_info *c, struct ubifs_zbranch *zbr, in lnc_add() argument
336 ubifs_assert(!zbr->leaf); in lnc_add()
337 ubifs_assert(zbr->len != 0); in lnc_add()
338 ubifs_assert(is_hash_key(c, &zbr->key)); in lnc_add()
347 lnc_node = kmemdup(node, zbr->len, GFP_NOFS); in lnc_add()
352 zbr->leaf = lnc_node; in lnc_add()
365 static int lnc_add_directly(struct ubifs_info *c, struct ubifs_zbranch *zbr, in lnc_add_directly() argument
370 ubifs_assert(!zbr->leaf); in lnc_add_directly()
371 ubifs_assert(zbr->len != 0); in lnc_add_directly()
380 zbr->leaf = node; in lnc_add_directly()
389 static void lnc_free(struct ubifs_zbranch *zbr) in lnc_free() argument
391 if (!zbr->leaf) in lnc_free()
393 kfree(zbr->leaf); in lnc_free()
394 zbr->leaf = NULL; in lnc_free()
408 static int tnc_read_node_nm(struct ubifs_info *c, struct ubifs_zbranch *zbr, in tnc_read_node_nm() argument
413 ubifs_assert(is_hash_key(c, &zbr->key)); in tnc_read_node_nm()
415 if (zbr->leaf) { in tnc_read_node_nm()
417 ubifs_assert(zbr->len != 0); in tnc_read_node_nm()
418 memcpy(node, zbr->leaf, zbr->len); in tnc_read_node_nm()
422 err = ubifs_tnc_read_node(c, zbr, node); in tnc_read_node_nm()
427 err = lnc_add(c, zbr, node); in tnc_read_node_nm()
504 struct ubifs_zbranch *zbr, void *node) in fallible_read_node() argument
508 dbg_tnck(key, "LEB %d:%d, key ", zbr->lnum, zbr->offs); in fallible_read_node()
510 ret = try_read_node(c, node, key_type(c, key), zbr->len, zbr->lnum, in fallible_read_node()
511 zbr->offs); in fallible_read_node()
523 zbr->lnum, zbr->offs, zbr->len); in fallible_read_node()
538 static int matches_name(struct ubifs_info *c, struct ubifs_zbranch *zbr, in matches_name() argument
545 if (!zbr->leaf) { in matches_name()
546 dent = kmalloc(zbr->len, GFP_NOFS); in matches_name()
550 err = ubifs_tnc_read_node(c, zbr, dent); in matches_name()
555 err = lnc_add_directly(c, zbr, dent); in matches_name()
559 dent = zbr->leaf; in matches_name()
591 struct ubifs_zbranch *zbr; in get_znode() local
593 zbr = &znode->zbranch[n]; in get_znode()
594 if (zbr->znode) in get_znode()
595 znode = zbr->znode; in get_znode()
597 znode = ubifs_load_znode(c, zbr, znode, n); in get_znode()
826 struct ubifs_zbranch *zbr, in fallible_matches_name() argument
833 if (!zbr->leaf) { in fallible_matches_name()
834 dent = kmalloc(zbr->len, GFP_NOFS); in fallible_matches_name()
838 err = fallible_read_node(c, &zbr->key, zbr, dent); in fallible_matches_name()
848 err = lnc_add_directly(c, zbr, dent); in fallible_matches_name()
852 dent = zbr->leaf; in fallible_matches_name()
1014 static int matches_position(struct ubifs_zbranch *zbr, int lnum, int offs) in matches_position() argument
1016 if (zbr->lnum == lnum && zbr->offs == offs) in matches_position()
1131 struct ubifs_zbranch *zbr; in dirty_cow_bottom_up() local
1137 zbr = &zp->zbranch[path[--p]]; in dirty_cow_bottom_up()
1138 znode = dirty_cow_znode(c, zbr); in dirty_cow_bottom_up()
1195 struct ubifs_zbranch *zbr; in ubifs_lookup_level0() local
1204 zbr = &znode->zbranch[*n]; in ubifs_lookup_level0()
1206 if (zbr->znode) { in ubifs_lookup_level0()
1208 znode = zbr->znode; in ubifs_lookup_level0()
1213 znode = ubifs_load_znode(c, zbr, znode, *n); in ubifs_lookup_level0()
1334 struct ubifs_zbranch *zbr; in lookup_level0_dirty() local
1343 zbr = &znode->zbranch[*n]; in lookup_level0_dirty()
1345 if (zbr->znode) { in lookup_level0_dirty()
1347 znode = dirty_cow_znode(c, zbr); in lookup_level0_dirty()
1354 znode = ubifs_load_znode(c, zbr, znode, *n); in lookup_level0_dirty()
1357 znode = dirty_cow_znode(c, zbr); in lookup_level0_dirty()
1451 struct ubifs_zbranch zbr, *zt; in ubifs_tnc_locate() local
1481 zbr = znode->zbranch[n]; in ubifs_tnc_locate()
1485 if (ubifs_get_wbuf(c, zbr.lnum)) { in ubifs_tnc_locate()
1487 err = ubifs_tnc_read_node(c, &zbr, node); in ubifs_tnc_locate()
1491 err = fallible_read_node(c, key, &zbr, node); in ubifs_tnc_locate()
1492 if (err <= 0 || maybe_leb_gced(c, zbr.lnum, gc_seq1)) { in ubifs_tnc_locate()
1551 struct ubifs_zbranch *zbr; in ubifs_tnc_get_bu_keys() local
1559 zbr = &znode->zbranch[n]; in ubifs_tnc_get_bu_keys()
1560 key = &zbr->key; in ubifs_tnc_get_bu_keys()
1569 lnum = zbr->lnum; in ubifs_tnc_get_bu_keys()
1570 offs = ALIGN(zbr->offs + zbr->len, 8); in ubifs_tnc_get_bu_keys()
1571 len = zbr->len; in ubifs_tnc_get_bu_keys()
1581 if (zbr->lnum != lnum || zbr->offs != offs) in ubifs_tnc_get_bu_keys()
1583 offs += ALIGN(zbr->len, 8); in ubifs_tnc_get_bu_keys()
1584 len = ALIGN(len, 8) + zbr->len; in ubifs_tnc_get_bu_keys()
1596 bu->zbranch[bu->cnt++] = *zbr; in ubifs_tnc_get_bu_keys()
1696 struct ubifs_zbranch *zbr) in validate_data_node() argument
1708 err = ubifs_check_node(c, buf, zbr->lnum, zbr->offs, 0, 0); in validate_data_node()
1715 if (len != zbr->len) { in validate_data_node()
1716 ubifs_err("bad node length %d, expected %d", len, zbr->len); in validate_data_node()
1722 if (!keys_eq(c, &zbr->key, &key1)) { in validate_data_node()
1724 zbr->lnum, zbr->offs); in validate_data_node()
1725 dbg_tnck(&zbr->key, "looked for key "); in validate_data_node()
1735 ubifs_err("bad node at LEB %d:%d", zbr->lnum, zbr->offs); in validate_data_node()
1923 const struct ubifs_zbranch *zbr, int n) in insert_zbranch() argument
1935 if (zbr->znode) in insert_zbranch()
1936 zbr->znode->iip = n; in insert_zbranch()
1941 znode->zbranch[n] = *zbr; in insert_zbranch()
1975 struct ubifs_zbranch *zbr, int n) in tnc_insert() argument
1979 union ubifs_key *key = &zbr->key, *key1; in tnc_insert()
1990 insert_zbranch(znode, zbr, n); in tnc_insert()
2072 zbr->znode->parent = zn; in tnc_insert()
2099 insert_zbranch(zi, zbr, n); in tnc_insert()
2110 zbr->key = zn->zbranch[0].key; in tnc_insert()
2111 zbr->znode = zn; in tnc_insert()
2112 zbr->lnum = 0; in tnc_insert()
2113 zbr->offs = 0; in tnc_insert()
2114 zbr->len = 0; in tnc_insert()
2176 struct ubifs_zbranch zbr; in ubifs_tnc_add() local
2178 zbr.znode = NULL; in ubifs_tnc_add()
2179 zbr.lnum = lnum; in ubifs_tnc_add()
2180 zbr.offs = offs; in ubifs_tnc_add()
2181 zbr.len = len; in ubifs_tnc_add()
2182 key_copy(c, key, &zbr.key); in ubifs_tnc_add()
2183 err = tnc_insert(c, znode, &zbr, n + 1); in ubifs_tnc_add()
2185 struct ubifs_zbranch *zbr = &znode->zbranch[n]; in ubifs_tnc_add() local
2187 lnc_free(zbr); in ubifs_tnc_add()
2188 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_add()
2189 zbr->lnum = lnum; in ubifs_tnc_add()
2190 zbr->offs = offs; in ubifs_tnc_add()
2191 zbr->len = len; in ubifs_tnc_add()
2231 struct ubifs_zbranch *zbr = &znode->zbranch[n]; in ubifs_tnc_replace() local
2234 if (zbr->lnum == old_lnum && zbr->offs == old_offs) { in ubifs_tnc_replace()
2235 lnc_free(zbr); in ubifs_tnc_replace()
2236 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_replace()
2239 zbr->lnum = lnum; in ubifs_tnc_replace()
2240 zbr->offs = offs; in ubifs_tnc_replace()
2241 zbr->len = len; in ubifs_tnc_replace()
2262 zbr = &znode->zbranch[n]; in ubifs_tnc_replace()
2263 lnc_free(zbr); in ubifs_tnc_replace()
2264 err = ubifs_add_dirt(c, zbr->lnum, in ubifs_tnc_replace()
2265 zbr->len); in ubifs_tnc_replace()
2268 zbr->lnum = lnum; in ubifs_tnc_replace()
2269 zbr->offs = offs; in ubifs_tnc_replace()
2270 zbr->len = len; in ubifs_tnc_replace()
2335 struct ubifs_zbranch *zbr = &znode->zbranch[n]; in ubifs_tnc_add_nm() local
2337 lnc_free(zbr); in ubifs_tnc_add_nm()
2338 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_add_nm()
2339 zbr->lnum = lnum; in ubifs_tnc_add_nm()
2340 zbr->offs = offs; in ubifs_tnc_add_nm()
2341 zbr->len = len; in ubifs_tnc_add_nm()
2347 struct ubifs_zbranch zbr; in ubifs_tnc_add_nm() local
2349 zbr.znode = NULL; in ubifs_tnc_add_nm()
2350 zbr.lnum = lnum; in ubifs_tnc_add_nm()
2351 zbr.offs = offs; in ubifs_tnc_add_nm()
2352 zbr.len = len; in ubifs_tnc_add_nm()
2353 key_copy(c, key, &zbr.key); in ubifs_tnc_add_nm()
2354 err = tnc_insert(c, znode, &zbr, n + 1); in ubifs_tnc_add_nm()
2392 struct ubifs_zbranch *zbr; in tnc_delete() local
2401 zbr = &znode->zbranch[n]; in tnc_delete()
2402 lnc_free(zbr); in tnc_delete()
2404 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in tnc_delete()
2461 zbr = &znode->zbranch[0]; in tnc_delete()
2465 znode = dirty_cow_znode(c, zbr); in tnc_delete()
2476 c->zroot.lnum = zbr->lnum; in tnc_delete()
2477 c->zroot.offs = zbr->offs; in tnc_delete()
2478 c->zroot.len = zbr->len; in tnc_delete()
2772 struct ubifs_zbranch *zbr; in ubifs_tnc_next_ent() local
2815 zbr = &znode->zbranch[n]; in ubifs_tnc_next_ent()
2816 dent = kmalloc(zbr->len, GFP_NOFS); in ubifs_tnc_next_ent()
2826 dkey = &zbr->key; in ubifs_tnc_next_ent()
2833 err = tnc_read_node_nm(c, zbr, dent); in ubifs_tnc_next_ent()
3146 struct ubifs_zbranch *zbr; in is_leaf_node_in_tnc() local
3156 zbr = &znode->zbranch[n]; in is_leaf_node_in_tnc()
3157 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()
3176 zbr = &znode->zbranch[n]; in is_leaf_node_in_tnc()
3177 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()
3192 zbr = &znode->zbranch[n]; in is_leaf_node_in_tnc()
3193 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()