• Home
  • Raw
  • Download

Lines Matching refs:zbr

26 			 struct ubifs_zbranch *zbr);
28 struct ubifs_zbranch *zbr, void *node);
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()
236 struct ubifs_znode *old_zn, struct ubifs_zbranch *zbr) in replace_znode() argument
254 zbr->znode = new_zn; in replace_znode()
255 zbr->lnum = 0; in replace_znode()
256 zbr->offs = 0; in replace_znode()
257 zbr->len = 0; in replace_znode()
270 struct ubifs_zbranch *zbr) in dirty_cow_znode() argument
272 struct ubifs_znode *znode = zbr->znode; in dirty_cow_znode()
282 err = add_idx_dirt(c, zbr->lnum, zbr->len); in dirty_cow_znode()
293 if (zbr->len) { in dirty_cow_znode()
301 old_idx->lnum = zbr->lnum; in dirty_cow_znode()
302 old_idx->offs = zbr->offs; in dirty_cow_znode()
304 err = add_idx_dirt(c, zbr->lnum, zbr->len); in dirty_cow_znode()
313 replace_znode(c, zn, znode, zbr); in dirty_cow_znode()
342 static int lnc_add(struct ubifs_info *c, struct ubifs_zbranch *zbr, in lnc_add() argument
349 ubifs_assert(c, !zbr->leaf); in lnc_add()
350 ubifs_assert(c, zbr->len != 0); in lnc_add()
351 ubifs_assert(c, is_hash_key(c, &zbr->key)); in lnc_add()
356 ubifs_dump_node(c, dent, zbr->len); in lnc_add()
360 lnc_node = kmemdup(node, zbr->len, GFP_NOFS); in lnc_add()
365 zbr->leaf = lnc_node; in lnc_add()
378 static int lnc_add_directly(struct ubifs_info *c, struct ubifs_zbranch *zbr, in lnc_add_directly() argument
383 ubifs_assert(c, !zbr->leaf); in lnc_add_directly()
384 ubifs_assert(c, zbr->len != 0); in lnc_add_directly()
389 ubifs_dump_node(c, node, zbr->len); in lnc_add_directly()
393 zbr->leaf = node; in lnc_add_directly()
401 static void lnc_free(struct ubifs_zbranch *zbr) in lnc_free() argument
403 if (!zbr->leaf) in lnc_free()
405 kfree(zbr->leaf); in lnc_free()
406 zbr->leaf = NULL; in lnc_free()
420 static int tnc_read_hashed_node(struct ubifs_info *c, struct ubifs_zbranch *zbr, in tnc_read_hashed_node() argument
425 ubifs_assert(c, is_hash_key(c, &zbr->key)); in tnc_read_hashed_node()
427 if (zbr->leaf) { in tnc_read_hashed_node()
429 ubifs_assert(c, zbr->len != 0); in tnc_read_hashed_node()
430 memcpy(node, zbr->leaf, zbr->len); in tnc_read_hashed_node()
435 err = fallible_read_node(c, &zbr->key, zbr, node); in tnc_read_hashed_node()
445 err = ubifs_tnc_read_node(c, zbr, node); in tnc_read_hashed_node()
451 err = lnc_add(c, zbr, node); in tnc_read_hashed_node()
478 struct ubifs_zbranch *zbr) in try_read_node() argument
480 int len = zbr->len; in try_read_node()
481 int lnum = zbr->lnum; in try_read_node()
482 int offs = zbr->offs; in try_read_node()
514 err = ubifs_node_check_hash(c, buf, zbr->hash); in try_read_node()
516 ubifs_bad_hash(c, buf, zbr->hash, lnum, offs); in try_read_node()
534 struct ubifs_zbranch *zbr, void *node) in fallible_read_node() argument
538 dbg_tnck(key, "LEB %d:%d, key ", zbr->lnum, zbr->offs); in fallible_read_node()
540 ret = try_read_node(c, node, key_type(c, key), zbr); in fallible_read_node()
552 zbr->lnum, zbr->offs, zbr->len); in fallible_read_node()
567 static int matches_name(struct ubifs_info *c, struct ubifs_zbranch *zbr, in matches_name() argument
574 if (!zbr->leaf) { in matches_name()
575 dent = kmalloc(zbr->len, GFP_NOFS); in matches_name()
579 err = ubifs_tnc_read_node(c, zbr, dent); in matches_name()
584 err = lnc_add_directly(c, zbr, dent); in matches_name()
588 dent = zbr->leaf; in matches_name()
620 struct ubifs_zbranch *zbr; in get_znode() local
622 zbr = &znode->zbranch[n]; in get_znode()
623 if (zbr->znode) in get_znode()
624 znode = zbr->znode; in get_znode()
626 znode = ubifs_load_znode(c, zbr, znode, n); in get_znode()
855 struct ubifs_zbranch *zbr, in fallible_matches_name() argument
862 if (!zbr->leaf) { in fallible_matches_name()
863 dent = kmalloc(zbr->len, GFP_NOFS); in fallible_matches_name()
867 err = fallible_read_node(c, &zbr->key, zbr, dent); in fallible_matches_name()
877 err = lnc_add_directly(c, zbr, dent); in fallible_matches_name()
881 dent = zbr->leaf; in fallible_matches_name()
1044 static int matches_position(struct ubifs_zbranch *zbr, int lnum, int offs) in matches_position() argument
1046 if (zbr->lnum == lnum && zbr->offs == offs) in matches_position()
1162 struct ubifs_zbranch *zbr; in dirty_cow_bottom_up() local
1168 zbr = &zp->zbranch[path[--p]]; in dirty_cow_bottom_up()
1169 znode = dirty_cow_znode(c, zbr); in dirty_cow_bottom_up()
1226 struct ubifs_zbranch *zbr; in ubifs_lookup_level0() local
1235 zbr = &znode->zbranch[*n]; in ubifs_lookup_level0()
1237 if (zbr->znode) { in ubifs_lookup_level0()
1239 znode = zbr->znode; in ubifs_lookup_level0()
1244 znode = ubifs_load_znode(c, zbr, znode, *n); in ubifs_lookup_level0()
1365 struct ubifs_zbranch *zbr; in lookup_level0_dirty() local
1374 zbr = &znode->zbranch[*n]; in lookup_level0_dirty()
1376 if (zbr->znode) { in lookup_level0_dirty()
1378 znode = dirty_cow_znode(c, zbr); in lookup_level0_dirty()
1385 znode = ubifs_load_znode(c, zbr, znode, *n); in lookup_level0_dirty()
1388 znode = dirty_cow_znode(c, zbr); in lookup_level0_dirty()
1482 struct ubifs_zbranch zbr, *zt; in ubifs_tnc_locate() local
1512 zbr = znode->zbranch[n]; in ubifs_tnc_locate()
1516 if (ubifs_get_wbuf(c, zbr.lnum)) { in ubifs_tnc_locate()
1518 err = ubifs_tnc_read_node(c, &zbr, node); in ubifs_tnc_locate()
1522 err = fallible_read_node(c, key, &zbr, node); in ubifs_tnc_locate()
1523 if (err <= 0 || maybe_leb_gced(c, zbr.lnum, gc_seq1)) { in ubifs_tnc_locate()
1582 struct ubifs_zbranch *zbr; in ubifs_tnc_get_bu_keys() local
1590 zbr = &znode->zbranch[n]; in ubifs_tnc_get_bu_keys()
1591 key = &zbr->key; in ubifs_tnc_get_bu_keys()
1600 lnum = zbr->lnum; in ubifs_tnc_get_bu_keys()
1601 offs = ALIGN(zbr->offs + zbr->len, 8); in ubifs_tnc_get_bu_keys()
1602 len = zbr->len; in ubifs_tnc_get_bu_keys()
1612 if (zbr->lnum != lnum || zbr->offs != offs) in ubifs_tnc_get_bu_keys()
1614 offs += ALIGN(zbr->len, 8); in ubifs_tnc_get_bu_keys()
1615 len = ALIGN(len, 8) + zbr->len; in ubifs_tnc_get_bu_keys()
1627 bu->zbranch[bu->cnt++] = *zbr; in ubifs_tnc_get_bu_keys()
1727 struct ubifs_zbranch *zbr) in validate_data_node() argument
1739 err = ubifs_check_node(c, buf, zbr->len, zbr->lnum, zbr->offs, 0, 0); in validate_data_node()
1745 err = ubifs_node_check_hash(c, buf, zbr->hash); in validate_data_node()
1747 ubifs_bad_hash(c, buf, zbr->hash, zbr->lnum, zbr->offs); in validate_data_node()
1752 if (len != zbr->len) { in validate_data_node()
1753 ubifs_err(c, "bad node length %d, expected %d", len, zbr->len); in validate_data_node()
1759 if (!keys_eq(c, &zbr->key, &key1)) { in validate_data_node()
1761 zbr->lnum, zbr->offs); in validate_data_node()
1762 dbg_tnck(&zbr->key, "looked for key "); in validate_data_node()
1772 ubifs_err(c, "bad node at LEB %d:%d", zbr->lnum, zbr->offs); in validate_data_node()
1773 ubifs_dump_node(c, buf, zbr->len); in validate_data_node()
1925 struct ubifs_zbranch *zbr; in search_dh_cookie() local
1935 zbr = &znode->zbranch[*n]; in search_dh_cookie()
1936 dkey = &zbr->key; in search_dh_cookie()
1943 err = tnc_read_hashed_node(c, zbr, dent); in search_dh_cookie()
2066 const struct ubifs_zbranch *zbr, int n) in insert_zbranch() argument
2078 if (zbr->znode) in insert_zbranch()
2079 zbr->znode->iip = n; in insert_zbranch()
2084 znode->zbranch[n] = *zbr; in insert_zbranch()
2118 struct ubifs_zbranch *zbr, int n) in tnc_insert() argument
2122 union ubifs_key *key = &zbr->key, *key1; in tnc_insert()
2133 insert_zbranch(c, znode, zbr, n); in tnc_insert()
2215 zbr->znode->parent = zn; in tnc_insert()
2242 insert_zbranch(c, zi, zbr, n); in tnc_insert()
2253 zbr->key = zn->zbranch[0].key; in tnc_insert()
2254 zbr->znode = zn; in tnc_insert()
2255 zbr->lnum = 0; in tnc_insert()
2256 zbr->offs = 0; in tnc_insert()
2257 zbr->len = 0; in tnc_insert()
2320 struct ubifs_zbranch zbr; in ubifs_tnc_add() local
2322 zbr.znode = NULL; in ubifs_tnc_add()
2323 zbr.lnum = lnum; in ubifs_tnc_add()
2324 zbr.offs = offs; in ubifs_tnc_add()
2325 zbr.len = len; in ubifs_tnc_add()
2326 ubifs_copy_hash(c, hash, zbr.hash); in ubifs_tnc_add()
2327 key_copy(c, key, &zbr.key); in ubifs_tnc_add()
2328 err = tnc_insert(c, znode, &zbr, n + 1); in ubifs_tnc_add()
2330 struct ubifs_zbranch *zbr = &znode->zbranch[n]; in ubifs_tnc_add() local
2332 lnc_free(zbr); in ubifs_tnc_add()
2333 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_add()
2334 zbr->lnum = lnum; in ubifs_tnc_add()
2335 zbr->offs = offs; in ubifs_tnc_add()
2336 zbr->len = len; in ubifs_tnc_add()
2337 ubifs_copy_hash(c, hash, zbr->hash); in ubifs_tnc_add()
2377 struct ubifs_zbranch *zbr = &znode->zbranch[n]; in ubifs_tnc_replace() local
2380 if (zbr->lnum == old_lnum && zbr->offs == old_offs) { in ubifs_tnc_replace()
2381 lnc_free(zbr); in ubifs_tnc_replace()
2382 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_replace()
2385 zbr->lnum = lnum; in ubifs_tnc_replace()
2386 zbr->offs = offs; in ubifs_tnc_replace()
2387 zbr->len = len; in ubifs_tnc_replace()
2408 zbr = &znode->zbranch[n]; in ubifs_tnc_replace()
2409 lnc_free(zbr); in ubifs_tnc_replace()
2410 err = ubifs_add_dirt(c, zbr->lnum, in ubifs_tnc_replace()
2411 zbr->len); in ubifs_tnc_replace()
2414 zbr->lnum = lnum; in ubifs_tnc_replace()
2415 zbr->offs = offs; in ubifs_tnc_replace()
2416 zbr->len = len; in ubifs_tnc_replace()
2482 struct ubifs_zbranch *zbr = &znode->zbranch[n]; in ubifs_tnc_add_nm() local
2484 lnc_free(zbr); in ubifs_tnc_add_nm()
2485 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_add_nm()
2486 zbr->lnum = lnum; in ubifs_tnc_add_nm()
2487 zbr->offs = offs; in ubifs_tnc_add_nm()
2488 zbr->len = len; in ubifs_tnc_add_nm()
2489 ubifs_copy_hash(c, hash, zbr->hash); in ubifs_tnc_add_nm()
2495 struct ubifs_zbranch zbr; in ubifs_tnc_add_nm() local
2497 zbr.znode = NULL; in ubifs_tnc_add_nm()
2498 zbr.lnum = lnum; in ubifs_tnc_add_nm()
2499 zbr.offs = offs; in ubifs_tnc_add_nm()
2500 zbr.len = len; in ubifs_tnc_add_nm()
2501 ubifs_copy_hash(c, hash, zbr.hash); in ubifs_tnc_add_nm()
2502 key_copy(c, key, &zbr.key); in ubifs_tnc_add_nm()
2503 err = tnc_insert(c, znode, &zbr, n + 1); in ubifs_tnc_add_nm()
2541 struct ubifs_zbranch *zbr; in tnc_delete() local
2550 zbr = &znode->zbranch[n]; in tnc_delete()
2551 lnc_free(zbr); in tnc_delete()
2553 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in tnc_delete()
2610 zbr = &znode->zbranch[0]; in tnc_delete()
2614 znode = dirty_cow_znode(c, zbr); in tnc_delete()
2625 c->zroot.lnum = zbr->lnum; in tnc_delete()
2626 c->zroot.offs = zbr->offs; in tnc_delete()
2627 c->zroot.len = zbr->len; in tnc_delete()
2737 struct ubifs_zbranch *zbr; in ubifs_tnc_remove_dh() local
2747 zbr = &znode->zbranch[n]; in ubifs_tnc_remove_dh()
2754 err = tnc_read_hashed_node(c, zbr, dent); in ubifs_tnc_remove_dh()
2994 struct ubifs_zbranch *zbr; in ubifs_tnc_next_ent() local
3041 zbr = &znode->zbranch[n]; in ubifs_tnc_next_ent()
3042 dent = kmalloc(zbr->len, GFP_NOFS); in ubifs_tnc_next_ent()
3052 dkey = &zbr->key; in ubifs_tnc_next_ent()
3059 err = tnc_read_hashed_node(c, zbr, dent); in ubifs_tnc_next_ent()
3388 struct ubifs_zbranch *zbr; in is_leaf_node_in_tnc() local
3398 zbr = &znode->zbranch[n]; in is_leaf_node_in_tnc()
3399 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()
3418 zbr = &znode->zbranch[n]; in is_leaf_node_in_tnc()
3419 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()
3434 zbr = &znode->zbranch[n]; in is_leaf_node_in_tnc()
3435 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()