Lines Matching defs:znode

869 		      const struct ubifs_znode *znode)
876 if (znode->parent)
877 zbr = &znode->parent->zbranch[znode->iip];
881 pr_err("znode %p, LEB %d:%d len %d parent %p iip %d level %d child_cnt %d flags %lx\n",
882 znode, zbr->lnum, zbr->offs, zbr->len, znode->parent, znode->iip,
883 znode->level, znode->child_cnt, znode->flags);
885 if (znode->child_cnt <= 0 || znode->child_cnt > c->fanout) {
891 for (n = 0; n < znode->child_cnt; n++) {
892 zbr = &znode->zbranch[n];
893 if (znode->level > 0)
894 pr_err("\t%d: znode %p LEB %d:%d len %d key %s\n",
895 n, zbr->znode, zbr->lnum, zbr->offs, zbr->len,
900 n, zbr->znode, zbr->lnum, zbr->offs, zbr->len,
943 struct ubifs_znode *znode;
948 if (c->zroot.znode) {
949 znode = ubifs_tnc_levelorder_next(c, c->zroot.znode, NULL);
950 level = znode->level;
952 while (znode) {
953 if (level != znode->level) {
954 level = znode->level;
957 ubifs_dump_znode(c, znode);
958 znode = ubifs_tnc_levelorder_next(c, c->zroot.znode, znode);
966 static int dump_znode(struct ubifs_info *c, struct ubifs_znode *znode,
969 ubifs_dump_znode(c, znode);
1281 * dbg_check_znode - check if znode is all right.
1283 * @zbr: zbranch which points to this znode
1285 * This function makes sure that znode referred to by @zbr is all right.
1290 struct ubifs_znode *znode = zbr->znode;
1291 struct ubifs_znode *zp = znode->parent;
1294 if (znode->child_cnt <= 0 || znode->child_cnt > c->fanout) {
1298 if (znode->level < 0) {
1302 if (znode->iip < 0 || znode->iip >= c->fanout) {
1309 if (!ubifs_zn_dirty(znode)) {
1314 if (ubifs_zn_dirty(znode)) {
1316 * If znode is dirty, its parent has to be dirty as well. The
1324 * TNC mutex, so znode's dirty flag may now have
1329 if (ubifs_zn_dirty(znode)) {
1339 if (znode->level != zp->level - 1) {
1344 /* Make sure the 'parent' pointer in our znode is correct */
1352 if (znode->iip >= zp->child_cnt) {
1357 if (znode->iip != n) {
1360 &zp->zbranch[znode->iip].key)) {
1364 n = znode->iip;
1368 * Make sure that the first key in our znode is greater than or
1372 cmp = keys_cmp(c, min, &znode->zbranch[0].key);
1382 * Make sure the last key in our znode is less or
1387 &znode->zbranch[znode->child_cnt - 1].key);
1394 /* This may only be root znode */
1405 for (n = 1; n < znode->child_cnt; n++) {
1406 cmp = keys_cmp(c, &znode->zbranch[n - 1].key,
1407 &znode->zbranch[n].key);
1414 if (!is_hash_key(c, &znode->zbranch[n].key)) {
1419 if (znode->level != 0 || c->replaying)
1426 err = dbg_check_key_order(c, &znode->zbranch[n - 1],
1427 &znode->zbranch[n]);
1437 for (n = 0; n < znode->child_cnt; n++) {
1438 if (!znode->zbranch[n].znode &&
1439 (znode->zbranch[n].lnum == 0 ||
1440 znode->zbranch[n].len == 0)) {
1445 if (znode->zbranch[n].lnum != 0 &&
1446 znode->zbranch[n].len == 0) {
1451 if (znode->zbranch[n].lnum == 0 &&
1452 znode->zbranch[n].len != 0) {
1457 if (znode->zbranch[n].lnum == 0 &&
1458 znode->zbranch[n].offs != 0) {
1463 if (znode->level != 0 && znode->zbranch[n].znode)
1464 if (znode->zbranch[n].znode->parent != znode) {
1474 ubifs_msg(c, "dump of the znode");
1475 ubifs_dump_znode(c, znode);
1477 ubifs_msg(c, "dump of the parent znode");
1489 * This function traverses whole TNC tree and checks every znode. Returns zero
1494 struct ubifs_znode *znode;
1502 if (!c->zroot.znode)
1505 znode = ubifs_tnc_postorder_first(c->zroot.znode);
1510 if (!znode->parent)
1513 zbr = &znode->parent->zbranch[znode->iip];
1520 if (ubifs_zn_dirty(znode))
1526 prev = znode;
1527 znode = ubifs_tnc_postorder_next(c, znode);
1528 if (!znode)
1532 * If the last key of this znode is equivalent to the first key
1533 * of the next znode (collision), then check order of the keys.
1536 if (prev->level == 0 && znode->level == 0 && !c->replaying &&
1538 &znode->zbranch[0].key)) {
1540 &znode->zbranch[0]);
1544 ubifs_msg(c, "first znode");
1546 ubifs_msg(c, "second znode");
1547 ubifs_dump_znode(c, znode);
1582 * It would be better if this function removed every znode it pulled to into
1591 struct ubifs_znode *znode, *child;
1595 if (!c->zroot.znode) {
1596 c->zroot.znode = ubifs_load_znode(c, &c->zroot, NULL, 0);
1597 if (IS_ERR(c->zroot.znode)) {
1598 err = PTR_ERR(c->zroot.znode);
1599 c->zroot.znode = NULL;
1609 znode = c->zroot.znode;
1610 while (znode->level > 0) {
1611 zbr = &znode->zbranch[0];
1612 child = zbr->znode;
1614 child = ubifs_load_znode(c, zbr, znode, 0);
1621 znode = child;
1631 err = znode_cb(c, znode, priv);
1633 ubifs_err(c, "znode checking function returned error %d",
1635 ubifs_dump_znode(c, znode);
1639 if (leaf_cb && znode->level == 0) {
1640 for (idx = 0; idx < znode->child_cnt; idx++) {
1641 zbr = &znode->zbranch[idx];
1651 if (!znode->parent)
1654 idx = znode->iip + 1;
1655 znode = znode->parent;
1656 if (idx < znode->child_cnt) {
1658 zbr = &znode->zbranch[idx];
1659 child = zbr->znode;
1661 child = ubifs_load_znode(c, zbr, znode, idx);
1666 zbr->znode = child;
1668 znode = child;
1676 /* Go to the lowest leftmost znode in the new sub-tree */
1677 while (znode->level > 0) {
1678 zbr = &znode->zbranch[0];
1679 child = zbr->znode;
1681 child = ubifs_load_znode(c, zbr, znode, 0);
1686 zbr->znode = child;
1688 znode = child;
1696 if (znode->parent)
1697 zbr = &znode->parent->zbranch[znode->iip];
1700 ubifs_msg(c, "dump of znode at LEB %d:%d", zbr->lnum, zbr->offs);
1701 ubifs_dump_znode(c, znode);
1708 * add_size - add znode size to partially calculated index size.
1710 * @znode: znode to add size for
1717 static int add_size(struct ubifs_info *c, struct ubifs_znode *znode, void *priv)
1722 add = ubifs_idx_node_sz(c, znode->child_cnt);
1939 struct ubifs_znode *znode;
1949 err = ubifs_lookup_level0(c, &key, &znode, &n);
1959 zbr = &znode->zbranch[n];
2174 struct ubifs_znode *znode;
2249 err = ubifs_lookup_level0(c, &key, &znode, &n);
2260 zbr = &znode->zbranch[n];