52 if (znode->
level == 0)
54 return ubifs_tnc_find_child(zr, 0);
67 while (znode->
parent != zr && iip >= znode->
parent->child_cnt) {
73 iip >= znode->
parent->child_cnt)) {
76 if (level_search || level < 0)
87 znode = ubifs_tnc_find_child(zr, 0);
92 zn = ubifs_tnc_find_child(znode->
parent, iip + 1);
95 iip = znode->
parent->child_cnt;
100 while (zn->
level != level) {
102 zn = ubifs_tnc_find_child(zn, 0);
147 cmp = keys_cmp(c, key, &zbr[
mid].key);
184 while (znode->
level > 0) {
187 child = ubifs_tnc_find_child(znode, 0);
212 zn = ubifs_tnc_find_child(znode->
parent, znode->
iip + 1);
231 long clean_freed = 0;
241 !ubifs_zn_dirty(zn->
zbranch[n].znode))
249 if (!ubifs_zn_dirty(zn))
292 dbg_tnc(
"LEB %d:%d, level %d, %d branch",
296 ubifs_err(
"current fanout %d, branch count %d",
298 ubifs_err(
"max levels %d, znode level %d",
305 const struct ubifs_branch *br = ubifs_idx_branch(c, idx, i);
308 key_read(c, &br->
key, &zbr->
key);
324 switch (key_type(c, &zbr->
key)) {
332 i, key_type(c, &zbr->
key));
340 type = key_type(c, &zbr->
key);
341 if (c->
ranges[type].max_len == 0) {
343 ubifs_err(
"bad target node (type %d) length (%d)",
349 }
else if (zbr->
len < c->
ranges[type].min_len ||
351 ubifs_err(
"bad target node (type %d) length (%d)",
353 ubifs_err(
"have to be in range of %d-%d",
365 for (i = 0; i < znode->
child_cnt - 1; i++) {
369 key2 = &znode->
zbranch[i + 1].key;
371 cmp = keys_cmp(c, key1, key2);
373 ubifs_err(
"bad key order (keys %d and %d)", i, i + 1);
376 }
else if (cmp == 0 && !is_hash_key(c, key1)) {
378 ubifs_err(
"keys %d and %d are not hashed but equivalent",
389 ubifs_err(
"bad indexing node at LEB %d:%d, error %d", lnum, offs, err);
422 err = read_znode(c, zbr->
lnum, zbr->
offs, zbr->
len, znode);
462 int err, type = key_type(c, key);
484 if (!keys_eq(c, key, &key1)) {
485 ubifs_err(
"bad key in node at LEB %d:%d",
488 dbg_tnck(&key1,
"but found node's key ");