• Home
  • Raw
  • Download

Lines Matching refs:zbr

115 		struct ubifs_zbranch *zbr;  in insert_old_idx_znode()  local
117 zbr = &znode->parent->zbranch[znode->iip]; in insert_old_idx_znode()
118 if (zbr->len) in insert_old_idx_znode()
119 return insert_old_idx(c, zbr->lnum, zbr->offs); in insert_old_idx_znode()
140 struct ubifs_zbranch *zbr; in ins_clr_old_idx_znode() local
142 zbr = &znode->parent->zbranch[znode->iip]; in ins_clr_old_idx_znode()
143 if (zbr->len) { in ins_clr_old_idx_znode()
144 err = insert_old_idx(c, zbr->lnum, zbr->offs); in ins_clr_old_idx_znode()
147 zbr->lnum = 0; in ins_clr_old_idx_znode()
148 zbr->offs = 0; in ins_clr_old_idx_znode()
149 zbr->len = 0; in ins_clr_old_idx_znode()
213 struct ubifs_zbranch *zbr = &zn->zbranch[i]; in copy_znode() local
215 if (zbr->znode) in copy_znode()
216 zbr->znode->parent = zn; in copy_znode()
246 struct ubifs_zbranch *zbr) in dirty_cow_znode() argument
248 struct ubifs_znode *znode = zbr->znode; in dirty_cow_znode()
258 err = add_idx_dirt(c, zbr->lnum, zbr->len); in dirty_cow_znode()
269 if (zbr->len) { in dirty_cow_znode()
270 err = insert_old_idx(c, zbr->lnum, zbr->offs); in dirty_cow_znode()
273 err = add_idx_dirt(c, zbr->lnum, zbr->len); in dirty_cow_znode()
277 zbr->znode = zn; in dirty_cow_znode()
278 zbr->lnum = 0; in dirty_cow_znode()
279 zbr->offs = 0; in dirty_cow_znode()
280 zbr->len = 0; in dirty_cow_znode()
307 static int lnc_add(struct ubifs_info *c, struct ubifs_zbranch *zbr, in lnc_add() argument
314 ubifs_assert(!zbr->leaf); in lnc_add()
315 ubifs_assert(zbr->len != 0); in lnc_add()
316 ubifs_assert(is_hash_key(c, &zbr->key)); in lnc_add()
325 lnc_node = kmemdup(node, zbr->len, GFP_NOFS); in lnc_add()
330 zbr->leaf = lnc_node; in lnc_add()
343 static int lnc_add_directly(struct ubifs_info *c, struct ubifs_zbranch *zbr, in lnc_add_directly() argument
348 ubifs_assert(!zbr->leaf); in lnc_add_directly()
349 ubifs_assert(zbr->len != 0); in lnc_add_directly()
358 zbr->leaf = node; in lnc_add_directly()
367 static void lnc_free(struct ubifs_zbranch *zbr) in lnc_free() argument
369 if (!zbr->leaf) in lnc_free()
371 kfree(zbr->leaf); in lnc_free()
372 zbr->leaf = NULL; in lnc_free()
386 static int tnc_read_node_nm(struct ubifs_info *c, struct ubifs_zbranch *zbr, in tnc_read_node_nm() argument
391 ubifs_assert(is_hash_key(c, &zbr->key)); in tnc_read_node_nm()
393 if (zbr->leaf) { in tnc_read_node_nm()
395 ubifs_assert(zbr->len != 0); in tnc_read_node_nm()
396 memcpy(node, zbr->leaf, zbr->len); in tnc_read_node_nm()
400 err = ubifs_tnc_read_node(c, zbr, node); in tnc_read_node_nm()
405 err = lnc_add(c, zbr, node); in tnc_read_node_nm()
482 struct ubifs_zbranch *zbr, void *node) in fallible_read_node() argument
486 dbg_tnck(key, "LEB %d:%d, key ", zbr->lnum, zbr->offs); in fallible_read_node()
488 ret = try_read_node(c, node, key_type(c, key), zbr->len, zbr->lnum, in fallible_read_node()
489 zbr->offs); in fallible_read_node()
501 zbr->lnum, zbr->offs, zbr->len); in fallible_read_node()
516 static int matches_name(struct ubifs_info *c, struct ubifs_zbranch *zbr, in matches_name() argument
523 if (!zbr->leaf) { in matches_name()
524 dent = kmalloc(zbr->len, GFP_NOFS); in matches_name()
528 err = ubifs_tnc_read_node(c, zbr, dent); in matches_name()
533 err = lnc_add_directly(c, zbr, dent); in matches_name()
537 dent = zbr->leaf; in matches_name()
569 struct ubifs_zbranch *zbr; in get_znode() local
571 zbr = &znode->zbranch[n]; in get_znode()
572 if (zbr->znode) in get_znode()
573 znode = zbr->znode; in get_znode()
575 znode = ubifs_load_znode(c, zbr, znode, n); in get_znode()
804 struct ubifs_zbranch *zbr, in fallible_matches_name() argument
811 if (!zbr->leaf) { in fallible_matches_name()
812 dent = kmalloc(zbr->len, GFP_NOFS); in fallible_matches_name()
816 err = fallible_read_node(c, &zbr->key, zbr, dent); in fallible_matches_name()
826 err = lnc_add_directly(c, zbr, dent); in fallible_matches_name()
830 dent = zbr->leaf; in fallible_matches_name()
992 static int matches_position(struct ubifs_zbranch *zbr, int lnum, int offs) in matches_position() argument
994 if (zbr->lnum == lnum && zbr->offs == offs) in matches_position()
1109 struct ubifs_zbranch *zbr; in dirty_cow_bottom_up() local
1115 zbr = &zp->zbranch[path[--p]]; in dirty_cow_bottom_up()
1116 znode = dirty_cow_znode(c, zbr); in dirty_cow_bottom_up()
1173 struct ubifs_zbranch *zbr; in ubifs_lookup_level0() local
1182 zbr = &znode->zbranch[*n]; in ubifs_lookup_level0()
1184 if (zbr->znode) { in ubifs_lookup_level0()
1186 znode = zbr->znode; in ubifs_lookup_level0()
1191 znode = ubifs_load_znode(c, zbr, znode, *n); in ubifs_lookup_level0()
1312 struct ubifs_zbranch *zbr; in lookup_level0_dirty() local
1321 zbr = &znode->zbranch[*n]; in lookup_level0_dirty()
1323 if (zbr->znode) { in lookup_level0_dirty()
1325 znode = dirty_cow_znode(c, zbr); in lookup_level0_dirty()
1332 znode = ubifs_load_znode(c, zbr, znode, *n); in lookup_level0_dirty()
1335 znode = dirty_cow_znode(c, zbr); in lookup_level0_dirty()
1433 struct ubifs_zbranch zbr, *zt; in ubifs_tnc_locate() local
1463 zbr = znode->zbranch[n]; in ubifs_tnc_locate()
1467 if (ubifs_get_wbuf(c, zbr.lnum)) { in ubifs_tnc_locate()
1469 err = ubifs_tnc_read_node(c, &zbr, node); in ubifs_tnc_locate()
1473 err = fallible_read_node(c, key, &zbr, node); in ubifs_tnc_locate()
1474 if (err <= 0 || maybe_leb_gced(c, zbr.lnum, gc_seq1)) { in ubifs_tnc_locate()
1533 struct ubifs_zbranch *zbr; in ubifs_tnc_get_bu_keys() local
1541 zbr = &znode->zbranch[n]; in ubifs_tnc_get_bu_keys()
1542 key = &zbr->key; in ubifs_tnc_get_bu_keys()
1551 lnum = zbr->lnum; in ubifs_tnc_get_bu_keys()
1552 offs = ALIGN(zbr->offs + zbr->len, 8); in ubifs_tnc_get_bu_keys()
1553 len = zbr->len; in ubifs_tnc_get_bu_keys()
1563 if (zbr->lnum != lnum || zbr->offs != offs) in ubifs_tnc_get_bu_keys()
1565 offs += ALIGN(zbr->len, 8); in ubifs_tnc_get_bu_keys()
1566 len = ALIGN(len, 8) + zbr->len; in ubifs_tnc_get_bu_keys()
1578 bu->zbranch[bu->cnt++] = *zbr; in ubifs_tnc_get_bu_keys()
1678 struct ubifs_zbranch *zbr) in validate_data_node() argument
1690 err = ubifs_check_node(c, buf, zbr->lnum, zbr->offs, 0, 0); in validate_data_node()
1697 if (len != zbr->len) { in validate_data_node()
1698 ubifs_err(c, "bad node length %d, expected %d", len, zbr->len); in validate_data_node()
1704 if (!keys_eq(c, &zbr->key, &key1)) { in validate_data_node()
1706 zbr->lnum, zbr->offs); in validate_data_node()
1707 dbg_tnck(&zbr->key, "looked for key "); in validate_data_node()
1717 ubifs_err(c, "bad node at LEB %d:%d", zbr->lnum, zbr->offs); in validate_data_node()
1905 const struct ubifs_zbranch *zbr, int n) in insert_zbranch() argument
1917 if (zbr->znode) in insert_zbranch()
1918 zbr->znode->iip = n; in insert_zbranch()
1923 znode->zbranch[n] = *zbr; in insert_zbranch()
1957 struct ubifs_zbranch *zbr, int n) in tnc_insert() argument
1961 union ubifs_key *key = &zbr->key, *key1; in tnc_insert()
1972 insert_zbranch(znode, zbr, n); in tnc_insert()
2054 zbr->znode->parent = zn; in tnc_insert()
2081 insert_zbranch(zi, zbr, n); in tnc_insert()
2092 zbr->key = zn->zbranch[0].key; in tnc_insert()
2093 zbr->znode = zn; in tnc_insert()
2094 zbr->lnum = 0; in tnc_insert()
2095 zbr->offs = 0; in tnc_insert()
2096 zbr->len = 0; in tnc_insert()
2158 struct ubifs_zbranch zbr; in ubifs_tnc_add() local
2160 zbr.znode = NULL; in ubifs_tnc_add()
2161 zbr.lnum = lnum; in ubifs_tnc_add()
2162 zbr.offs = offs; in ubifs_tnc_add()
2163 zbr.len = len; in ubifs_tnc_add()
2164 key_copy(c, key, &zbr.key); in ubifs_tnc_add()
2165 err = tnc_insert(c, znode, &zbr, n + 1); in ubifs_tnc_add()
2167 struct ubifs_zbranch *zbr = &znode->zbranch[n]; in ubifs_tnc_add() local
2169 lnc_free(zbr); in ubifs_tnc_add()
2170 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_add()
2171 zbr->lnum = lnum; in ubifs_tnc_add()
2172 zbr->offs = offs; in ubifs_tnc_add()
2173 zbr->len = len; in ubifs_tnc_add()
2213 struct ubifs_zbranch *zbr = &znode->zbranch[n]; in ubifs_tnc_replace() local
2216 if (zbr->lnum == old_lnum && zbr->offs == old_offs) { in ubifs_tnc_replace()
2217 lnc_free(zbr); in ubifs_tnc_replace()
2218 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_replace()
2221 zbr->lnum = lnum; in ubifs_tnc_replace()
2222 zbr->offs = offs; in ubifs_tnc_replace()
2223 zbr->len = len; in ubifs_tnc_replace()
2244 zbr = &znode->zbranch[n]; in ubifs_tnc_replace()
2245 lnc_free(zbr); in ubifs_tnc_replace()
2246 err = ubifs_add_dirt(c, zbr->lnum, in ubifs_tnc_replace()
2247 zbr->len); in ubifs_tnc_replace()
2250 zbr->lnum = lnum; in ubifs_tnc_replace()
2251 zbr->offs = offs; in ubifs_tnc_replace()
2252 zbr->len = len; in ubifs_tnc_replace()
2317 struct ubifs_zbranch *zbr = &znode->zbranch[n]; in ubifs_tnc_add_nm() local
2319 lnc_free(zbr); in ubifs_tnc_add_nm()
2320 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in ubifs_tnc_add_nm()
2321 zbr->lnum = lnum; in ubifs_tnc_add_nm()
2322 zbr->offs = offs; in ubifs_tnc_add_nm()
2323 zbr->len = len; in ubifs_tnc_add_nm()
2329 struct ubifs_zbranch zbr; in ubifs_tnc_add_nm() local
2331 zbr.znode = NULL; in ubifs_tnc_add_nm()
2332 zbr.lnum = lnum; in ubifs_tnc_add_nm()
2333 zbr.offs = offs; in ubifs_tnc_add_nm()
2334 zbr.len = len; in ubifs_tnc_add_nm()
2335 key_copy(c, key, &zbr.key); in ubifs_tnc_add_nm()
2336 err = tnc_insert(c, znode, &zbr, n + 1); in ubifs_tnc_add_nm()
2374 struct ubifs_zbranch *zbr; in tnc_delete() local
2383 zbr = &znode->zbranch[n]; in tnc_delete()
2384 lnc_free(zbr); in tnc_delete()
2386 err = ubifs_add_dirt(c, zbr->lnum, zbr->len); in tnc_delete()
2443 zbr = &znode->zbranch[0]; in tnc_delete()
2447 znode = dirty_cow_znode(c, zbr); in tnc_delete()
2458 c->zroot.lnum = zbr->lnum; in tnc_delete()
2459 c->zroot.offs = zbr->offs; in tnc_delete()
2460 c->zroot.len = zbr->len; in tnc_delete()
2754 struct ubifs_zbranch *zbr; in ubifs_tnc_next_ent() local
2797 zbr = &znode->zbranch[n]; in ubifs_tnc_next_ent()
2798 dent = kmalloc(zbr->len, GFP_NOFS); in ubifs_tnc_next_ent()
2808 dkey = &zbr->key; in ubifs_tnc_next_ent()
2815 err = tnc_read_node_nm(c, zbr, dent); in ubifs_tnc_next_ent()
3129 struct ubifs_zbranch *zbr; in is_leaf_node_in_tnc() local
3139 zbr = &znode->zbranch[n]; in is_leaf_node_in_tnc()
3140 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()
3159 zbr = &znode->zbranch[n]; in is_leaf_node_in_tnc()
3160 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()
3175 zbr = &znode->zbranch[n]; in is_leaf_node_in_tnc()
3176 if (lnum == zbr->lnum && offs == zbr->offs) in is_leaf_node_in_tnc()