Lines Matching refs:nnode
30 static struct ubifs_cnode *first_dirty_cnode(const struct ubifs_info *c, struct ubifs_nnode *nnode) in first_dirty_cnode() argument
32 ubifs_assert(c, nnode); in first_dirty_cnode()
39 cnode = nnode->nbranch[i].cnode; in first_dirty_cnode()
44 nnode = (struct ubifs_nnode *)cnode; in first_dirty_cnode()
50 return (struct ubifs_cnode *)nnode; in first_dirty_cnode()
63 struct ubifs_nnode *nnode; in next_dirty_cnode() local
67 nnode = cnode->parent; in next_dirty_cnode()
68 if (!nnode) in next_dirty_cnode()
71 cnode = nnode->nbranch[i].cnode; in next_dirty_cnode()
79 return (struct ubifs_cnode *)nnode; in next_dirty_cnode()
555 struct ubifs_nnode *nnode; in next_pnode_to_dirty() local
559 nnode = pnode->parent; in next_pnode_to_dirty()
561 if (nnode->nbranch[iip].lnum) in next_pnode_to_dirty()
562 return ubifs_get_pnode(c, nnode, iip); in next_pnode_to_dirty()
567 iip = nnode->iip + 1; in next_pnode_to_dirty()
568 nnode = nnode->parent; in next_pnode_to_dirty()
569 if (!nnode) in next_pnode_to_dirty()
572 if (nnode->nbranch[iip].lnum) in next_pnode_to_dirty()
578 nnode = ubifs_get_nnode(c, nnode, iip); in next_pnode_to_dirty()
579 if (IS_ERR(nnode)) in next_pnode_to_dirty()
580 return (void *)nnode; in next_pnode_to_dirty()
583 while (nnode->level > 1) { in next_pnode_to_dirty()
585 if (nnode->nbranch[iip].lnum) in next_pnode_to_dirty()
595 nnode = ubifs_get_nnode(c, nnode, iip); in next_pnode_to_dirty()
596 if (IS_ERR(nnode)) in next_pnode_to_dirty()
597 return (void *)nnode; in next_pnode_to_dirty()
601 if (nnode->nbranch[iip].lnum) in next_pnode_to_dirty()
606 return ubifs_get_pnode(c, nnode, iip); in next_pnode_to_dirty()
629 struct ubifs_nnode *nnode; in do_make_pnode_dirty() local
634 nnode = pnode->parent; in do_make_pnode_dirty()
635 while (nnode) { in do_make_pnode_dirty()
636 if (!test_and_set_bit(DIRTY_CNODE, &nnode->flags)) { in do_make_pnode_dirty()
638 ubifs_add_nnode_dirt(c, nnode); in do_make_pnode_dirty()
639 nnode = nnode->parent; in do_make_pnode_dirty()
825 struct ubifs_nnode *nnode; in nnode_lookup() local
832 nnode = c->nroot; in nnode_lookup()
838 nnode = ubifs_get_nnode(c, nnode, iip); in nnode_lookup()
839 if (IS_ERR(nnode)) in nnode_lookup()
840 return nnode; in nnode_lookup()
842 return nnode; in nnode_lookup()
863 struct ubifs_nnode *nnode; in make_nnode_dirty() local
865 nnode = nnode_lookup(c, node_num); in make_nnode_dirty()
866 if (IS_ERR(nnode)) in make_nnode_dirty()
867 return PTR_ERR(nnode); in make_nnode_dirty()
868 if (nnode->parent) { in make_nnode_dirty()
871 branch = &nnode->parent->nbranch[nnode->iip]; in make_nnode_dirty()
877 if (!test_and_set_bit(DIRTY_CNODE, &nnode->flags)) { in make_nnode_dirty()
879 ubifs_add_nnode_dirt(c, nnode); in make_nnode_dirty()
881 nnode = nnode->parent; in make_nnode_dirty()
882 while (nnode) { in make_nnode_dirty()
883 if (!test_and_set_bit(DIRTY_CNODE, &nnode->flags)) { in make_nnode_dirty()
885 ubifs_add_nnode_dirt(c, nnode); in make_nnode_dirty()
886 nnode = nnode->parent; in make_nnode_dirty()
1341 struct ubifs_nnode *nnode; in first_nnode() local
1344 nnode = c->nroot; in first_nnode()
1346 if (!nnode) in first_nnode()
1351 if (nnode->nbranch[i].nnode) { in first_nnode()
1353 nnode = nnode->nbranch[i].nnode; in first_nnode()
1361 return nnode; in first_nnode()
1374 struct ubifs_nnode *nnode, int *hght) in next_nnode() argument
1379 parent = nnode->parent; in next_nnode()
1382 if (nnode->iip == UBIFS_LPT_FANOUT - 1) { in next_nnode()
1386 for (iip = nnode->iip + 1; iip < UBIFS_LPT_FANOUT; iip++) { in next_nnode()
1387 nnode = parent->nbranch[iip].nnode; in next_nnode()
1388 if (nnode) in next_nnode()
1391 if (!nnode) { in next_nnode()
1398 if (nnode->nbranch[i].nnode) { in next_nnode()
1400 nnode = nnode->nbranch[i].nnode; in next_nnode()
1408 return nnode; in next_nnode()
1418 struct ubifs_nnode *nnode; in ubifs_lpt_free() local
1437 nnode = first_nnode(c, &hght); in ubifs_lpt_free()
1438 while (nnode) { in ubifs_lpt_free()
1440 kfree(nnode->nbranch[i].nnode); in ubifs_lpt_free()
1441 nnode = next_nnode(c, nnode, &hght); in ubifs_lpt_free()
1478 struct ubifs_nnode *nnode; in dbg_is_nnode_dirty() local
1482 nnode = first_nnode(c, &hght); in dbg_is_nnode_dirty()
1483 for (; nnode; nnode = next_nnode(c, nnode, &hght)) { in dbg_is_nnode_dirty()
1487 if (nnode->parent) { in dbg_is_nnode_dirty()
1488 branch = &nnode->parent->nbranch[nnode->iip]; in dbg_is_nnode_dirty()
1491 if (test_bit(DIRTY_CNODE, &nnode->flags)) in dbg_is_nnode_dirty()
1497 if (test_bit(DIRTY_CNODE, &nnode->flags)) in dbg_is_nnode_dirty()
1892 struct ubifs_nnode nnode; in dump_lpt_leb() local
1901 err = ubifs_unpack_nnode(c, p, &nnode); in dump_lpt_leb()
1908 pr_cont("%d:%d", nnode.nbranch[i].lnum, in dump_lpt_leb()
1909 nnode.nbranch[i].offs); in dump_lpt_leb()