Lines Matching refs:cnode
49 struct ubifs_cnode *cnode; in first_dirty_cnode() local
51 cnode = nnode->nbranch[i].cnode; in first_dirty_cnode()
52 if (cnode && in first_dirty_cnode()
53 test_bit(DIRTY_CNODE, &cnode->flags)) { in first_dirty_cnode()
54 if (cnode->level == 0) in first_dirty_cnode()
55 return cnode; in first_dirty_cnode()
56 nnode = (struct ubifs_nnode *)cnode; in first_dirty_cnode()
73 static struct ubifs_cnode *next_dirty_cnode(const struct ubifs_info *c, struct ubifs_cnode *cnode) in next_dirty_cnode() argument
78 ubifs_assert(c, cnode); in next_dirty_cnode()
79 nnode = cnode->parent; in next_dirty_cnode()
82 for (i = cnode->iip + 1; i < UBIFS_LPT_FANOUT; i++) { in next_dirty_cnode()
83 cnode = nnode->nbranch[i].cnode; in next_dirty_cnode()
84 if (cnode && test_bit(DIRTY_CNODE, &cnode->flags)) { in next_dirty_cnode()
85 if (cnode->level == 0) in next_dirty_cnode()
86 return cnode; /* cnode is a pnode */ in next_dirty_cnode()
88 return first_dirty_cnode(c, (struct ubifs_nnode *)cnode); in next_dirty_cnode()
102 struct ubifs_cnode *cnode, *cnext; in get_cnodes_to_commit() local
112 cnode = c->lpt_cnext; in get_cnodes_to_commit()
113 if (!cnode) in get_cnodes_to_commit()
117 ubifs_assert(c, !test_bit(COW_CNODE, &cnode->flags)); in get_cnodes_to_commit()
118 __set_bit(COW_CNODE, &cnode->flags); in get_cnodes_to_commit()
119 cnext = next_dirty_cnode(c, cnode); in get_cnodes_to_commit()
121 cnode->cnext = c->lpt_cnext; in get_cnodes_to_commit()
124 cnode->cnext = cnext; in get_cnodes_to_commit()
125 cnode = cnext; in get_cnodes_to_commit()
197 struct ubifs_cnode *cnode; in layout_cnodes() local
202 cnode = c->lpt_cnext; in layout_cnodes()
203 if (!cnode) in layout_cnodes()
227 if (cnode->level) { in layout_cnodes()
263 if (cnode->parent) { in layout_cnodes()
264 cnode->parent->nbranch[cnode->iip].lnum = lnum; in layout_cnodes()
265 cnode->parent->nbranch[cnode->iip].offs = offs; in layout_cnodes()
272 cnode = cnode->cnext; in layout_cnodes()
273 } while (cnode && cnode != c->lpt_cnext); in layout_cnodes()
375 struct ubifs_cnode *cnode; in write_cnodes() local
378 cnode = c->lpt_cnext; in write_cnodes()
379 if (!cnode) in write_cnodes()
409 if (cnode->level) in write_cnodes()
450 if (cnode->level) in write_cnodes()
452 (struct ubifs_nnode *)cnode); in write_cnodes()
455 (struct ubifs_pnode *)cnode); in write_cnodes()
462 clear_bit(DIRTY_CNODE, &cnode->flags); in write_cnodes()
464 clear_bit(COW_CNODE, &cnode->flags); in write_cnodes()
468 cnode = cnode->cnext; in write_cnodes()
469 } while (cnode && cnode != c->lpt_cnext); in write_cnodes()
1298 struct ubifs_cnode *cnode, *cnext; in free_obsolete_cnodes() local
1304 cnode = cnext; in free_obsolete_cnodes()
1305 cnext = cnode->cnext; in free_obsolete_cnodes()
1306 if (test_bit(OBSOLETE_CNODE, &cnode->flags)) in free_obsolete_cnodes()
1307 kfree(cnode); in free_obsolete_cnodes()
1309 cnode->cnext = NULL; in free_obsolete_cnodes()