Lines Matching refs:nnode

384 		      struct ubifs_nnode *nnode)  in ubifs_pack_nnode()  argument
392 pack_bits(&addr, &pos, nnode->num, c->pcnt_bits); in ubifs_pack_nnode()
394 int lnum = nnode->nbranch[i].lnum; in ubifs_pack_nnode()
399 pack_bits(&addr, &pos, nnode->nbranch[i].offs, in ubifs_pack_nnode()
494 void ubifs_add_nnode_dirt(struct ubifs_info *c, struct ubifs_nnode *nnode) in ubifs_add_nnode_dirt() argument
496 struct ubifs_nnode *np = nnode->parent; in ubifs_add_nnode_dirt()
499 ubifs_add_lpt_dirt(c, np->nbranch[nnode->iip].lnum, in ubifs_add_nnode_dirt()
614 struct ubifs_nnode *nnode = NULL; in ubifs_create_dflt_lpt() local
633 nnode = kzalloc(sizeof(struct ubifs_nnode), GFP_KERNEL); in ubifs_create_dflt_lpt()
636 if (!pnode || !nnode || !buf || !ltab || !lsave) { in ubifs_create_dflt_lpt()
754 nnode->nbranch[j].lnum = blnum; in ubifs_create_dflt_lpt()
755 nnode->nbranch[j].offs = boffs; in ubifs_create_dflt_lpt()
759 nnode->nbranch[j].lnum = 0; in ubifs_create_dflt_lpt()
760 nnode->nbranch[j].offs = 0; in ubifs_create_dflt_lpt()
763 nnode->num = calc_nnode_num(row, i); in ubifs_create_dflt_lpt()
764 ubifs_pack_nnode(c, p, nnode); in ubifs_create_dflt_lpt()
859 kfree(nnode); in ubifs_create_dflt_lpt()
1004 struct ubifs_nnode *nnode) in ubifs_unpack_nnode() argument
1013 nnode->num = ubifs_unpack_bits(&addr, &pos, c->pcnt_bits); in ubifs_unpack_nnode()
1021 nnode->nbranch[i].lnum = lnum; in ubifs_unpack_nnode()
1022 nnode->nbranch[i].offs = ubifs_unpack_bits(&addr, &pos, in ubifs_unpack_nnode()
1096 static int validate_nnode(const struct ubifs_info *c, struct ubifs_nnode *nnode, in validate_nnode() argument
1104 if (nnode->num != num) in validate_nnode()
1115 int lnum = nnode->nbranch[i].lnum; in validate_nnode()
1116 int offs = nnode->nbranch[i].offs; in validate_nnode()
1198 struct ubifs_nnode *nnode = NULL; in ubifs_read_nnode() local
1210 nnode = kzalloc(sizeof(struct ubifs_nnode), GFP_NOFS); in ubifs_read_nnode()
1211 if (!nnode) { in ubifs_read_nnode()
1223 nnode->num = calc_nnode_num_from_parent(c, parent, iip); in ubifs_read_nnode()
1228 err = ubifs_unpack_nnode(c, buf, nnode); in ubifs_read_nnode()
1232 err = validate_nnode(c, nnode, parent, iip); in ubifs_read_nnode()
1236 nnode->num = calc_nnode_num_from_parent(c, parent, iip); in ubifs_read_nnode()
1238 branch->nnode = nnode; in ubifs_read_nnode()
1239 nnode->level = parent->level - 1; in ubifs_read_nnode()
1241 c->nroot = nnode; in ubifs_read_nnode()
1242 nnode->level = c->lpt_hght; in ubifs_read_nnode()
1244 nnode->parent = parent; in ubifs_read_nnode()
1245 nnode->iip = iip; in ubifs_read_nnode()
1250 kfree(nnode); in ubifs_read_nnode()
1397 struct ubifs_nnode *nnode; in ubifs_get_nnode() local
1401 nnode = branch->nnode; in ubifs_get_nnode()
1402 if (nnode) in ubifs_get_nnode()
1403 return nnode; in ubifs_get_nnode()
1407 return branch->nnode; in ubifs_get_nnode()
1448 struct ubifs_nnode *nnode; in ubifs_lpt_lookup() local
1456 nnode = c->nroot; in ubifs_lpt_lookup()
1462 nnode = ubifs_get_nnode(c, nnode, iip); in ubifs_lpt_lookup()
1463 if (IS_ERR(nnode)) in ubifs_lpt_lookup()
1464 return ERR_CAST(nnode); in ubifs_lpt_lookup()
1468 pnode = ubifs_get_pnode(c, nnode, iip); in ubifs_lpt_lookup()
1486 struct ubifs_nnode *nnode) in dirty_cow_nnode() argument
1491 if (!test_bit(COW_CNODE, &nnode->flags)) { in dirty_cow_nnode()
1493 if (!test_and_set_bit(DIRTY_CNODE, &nnode->flags)) { in dirty_cow_nnode()
1495 ubifs_add_nnode_dirt(c, nnode); in dirty_cow_nnode()
1497 return nnode; in dirty_cow_nnode()
1505 memcpy(n, nnode, sizeof(struct ubifs_nnode)); in dirty_cow_nnode()
1518 ubifs_assert(!test_bit(OBSOLETE_CNODE, &nnode->flags)); in dirty_cow_nnode()
1519 __set_bit(OBSOLETE_CNODE, &nnode->flags); in dirty_cow_nnode()
1522 ubifs_add_nnode_dirt(c, nnode); in dirty_cow_nnode()
1523 if (nnode->parent) in dirty_cow_nnode()
1524 nnode->parent->nbranch[n->iip].nnode = n; in dirty_cow_nnode()
1582 struct ubifs_nnode *nnode; in ubifs_lpt_lookup_dirty() local
1590 nnode = c->nroot; in ubifs_lpt_lookup_dirty()
1591 nnode = dirty_cow_nnode(c, nnode); in ubifs_lpt_lookup_dirty()
1592 if (IS_ERR(nnode)) in ubifs_lpt_lookup_dirty()
1593 return ERR_CAST(nnode); in ubifs_lpt_lookup_dirty()
1599 nnode = ubifs_get_nnode(c, nnode, iip); in ubifs_lpt_lookup_dirty()
1600 if (IS_ERR(nnode)) in ubifs_lpt_lookup_dirty()
1601 return ERR_CAST(nnode); in ubifs_lpt_lookup_dirty()
1602 nnode = dirty_cow_nnode(c, nnode); in ubifs_lpt_lookup_dirty()
1603 if (IS_ERR(nnode)) in ubifs_lpt_lookup_dirty()
1604 return ERR_CAST(nnode); in ubifs_lpt_lookup_dirty()
1608 pnode = ubifs_get_pnode(c, nnode, iip); in ubifs_lpt_lookup_dirty()
1765 struct ubifs_nnode nnode; member
1771 struct ubifs_nnode *nnode; member
1792 struct ubifs_nnode *nnode; in scan_get_nnode() local
1797 nnode = branch->nnode; in scan_get_nnode()
1798 if (nnode) { in scan_get_nnode()
1800 path->ptr.nnode = nnode; in scan_get_nnode()
1801 return nnode; in scan_get_nnode()
1803 nnode = &path->nnode; in scan_get_nnode()
1805 path->ptr.nnode = nnode; in scan_get_nnode()
1806 memset(nnode, 0, sizeof(struct ubifs_nnode)); in scan_get_nnode()
1815 nnode->num = calc_nnode_num_from_parent(c, parent, iip); in scan_get_nnode()
1821 err = ubifs_unpack_nnode(c, buf, nnode); in scan_get_nnode()
1825 err = validate_nnode(c, nnode, parent, iip); in scan_get_nnode()
1829 nnode->num = calc_nnode_num_from_parent(c, parent, iip); in scan_get_nnode()
1830 nnode->level = parent->level - 1; in scan_get_nnode()
1831 nnode->parent = parent; in scan_get_nnode()
1832 nnode->iip = iip; in scan_get_nnode()
1833 return nnode; in scan_get_nnode()
1919 struct ubifs_nnode *nnode; in ubifs_lpt_scan_nolock() local
1943 path[0].ptr.nnode = c->nroot; in ubifs_lpt_scan_nolock()
1947 nnode = c->nroot; in ubifs_lpt_scan_nolock()
1953 nnode = scan_get_nnode(c, path + h, nnode, iip); in ubifs_lpt_scan_nolock()
1954 if (IS_ERR(nnode)) { in ubifs_lpt_scan_nolock()
1955 err = PTR_ERR(nnode); in ubifs_lpt_scan_nolock()
1961 pnode = scan_get_pnode(c, path + h, nnode, iip); in ubifs_lpt_scan_nolock()
1986 nnode = kmalloc(sz, GFP_NOFS); in ubifs_lpt_scan_nolock()
1987 if (!nnode) { in ubifs_lpt_scan_nolock()
1991 memcpy(nnode, &path[h].nnode, sz); in ubifs_lpt_scan_nolock()
1992 parent = nnode->parent; in ubifs_lpt_scan_nolock()
1993 parent->nbranch[nnode->iip].nnode = nnode; in ubifs_lpt_scan_nolock()
1994 path[h].ptr.nnode = nnode; in ubifs_lpt_scan_nolock()
1996 path[h + 1].cnode.parent = nnode; in ubifs_lpt_scan_nolock()
2053 nnode = path[h].ptr.nnode; in ubifs_lpt_scan_nolock()
2056 iip = nnode->iip; in ubifs_lpt_scan_nolock()
2063 nnode = scan_get_nnode(c, path + h, nnode, iip); in ubifs_lpt_scan_nolock()
2064 if (IS_ERR(nnode)) { in ubifs_lpt_scan_nolock()
2065 err = PTR_ERR(nnode); in ubifs_lpt_scan_nolock()
2070 pnode = scan_get_pnode(c, path + h, nnode, iip); in ubifs_lpt_scan_nolock()
2223 struct ubifs_nnode *nnode, *nn; in dbg_check_lpt_nodes() local
2232 nnode = cnode->parent; in dbg_check_lpt_nodes()
2239 (nnode ? nnode->num : 0), cnode->iip); in dbg_check_lpt_nodes()
2272 cnode = (struct ubifs_cnode *)nnode; in dbg_check_lpt_nodes()