Lines Matching refs:znode
26 struct ubifs_znode *znode, int lnum, int offs, int len) in make_idx_node() argument
34 idx->child_cnt = cpu_to_le16(znode->child_cnt); in make_idx_node()
35 idx->level = cpu_to_le16(znode->level); in make_idx_node()
36 for (i = 0; i < znode->child_cnt; i++) { in make_idx_node()
38 struct ubifs_zbranch *zbr = &znode->zbranch[i]; in make_idx_node()
47 ubifs_dump_znode(c, znode); in make_idx_node()
48 if (zbr->znode) in make_idx_node()
49 ubifs_dump_znode(c, zbr->znode); in make_idx_node()
57 znode->lnum = lnum; in make_idx_node()
58 znode->offs = offs; in make_idx_node()
59 znode->len = len; in make_idx_node()
61 err = insert_old_idx_znode(c, znode); in make_idx_node()
64 zp = znode->parent; in make_idx_node()
68 zbr = &zp->zbranch[znode->iip]; in make_idx_node()
83 ubifs_assert(c, ubifs_zn_dirty(znode)); in make_idx_node()
84 ubifs_assert(c, ubifs_zn_cow(znode)); in make_idx_node()
90 __clear_bit(DIRTY_ZNODE, &znode->flags); in make_idx_node()
91 __clear_bit(COW_ZNODE, &znode->flags); in make_idx_node()
123 struct ubifs_znode *znode = c->enext; in fill_gap() local
128 err = make_idx_node(c, c->ileb_buf + gap_pos, znode, in fill_gap()
134 c->enext = znode->cnext; in fill_gap()
431 struct ubifs_znode *znode, *cnext, *zp; in layout_in_empty_space() local
453 znode = cnext; in layout_in_empty_space()
455 len = ubifs_idx_node_sz(c, znode->child_cnt); in layout_in_empty_space()
471 znode->lnum = lnum; in layout_in_empty_space()
472 znode->offs = offs; in layout_in_empty_space()
473 znode->len = len; in layout_in_empty_space()
476 zp = znode->parent; in layout_in_empty_space()
481 i = znode->iip; in layout_in_empty_space()
503 cnext = znode->cnext; in layout_in_empty_space()
585 static struct ubifs_znode *find_first_dirty(struct ubifs_znode *znode) in find_first_dirty() argument
589 if (!znode) in find_first_dirty()
593 if (znode->level == 0) { in find_first_dirty()
594 if (ubifs_zn_dirty(znode)) in find_first_dirty()
595 return znode; in find_first_dirty()
599 for (i = 0; i < znode->child_cnt; i++) { in find_first_dirty()
600 struct ubifs_zbranch *zbr = &znode->zbranch[i]; in find_first_dirty()
602 if (zbr->znode && ubifs_zn_dirty(zbr->znode)) { in find_first_dirty()
603 znode = zbr->znode; in find_first_dirty()
609 if (ubifs_zn_dirty(znode)) in find_first_dirty()
610 return znode; in find_first_dirty()
620 static struct ubifs_znode *find_next_dirty(struct ubifs_znode *znode) in find_next_dirty() argument
622 int n = znode->iip + 1; in find_next_dirty()
624 znode = znode->parent; in find_next_dirty()
625 if (!znode) in find_next_dirty()
627 for (; n < znode->child_cnt; n++) { in find_next_dirty()
628 struct ubifs_zbranch *zbr = &znode->zbranch[n]; in find_next_dirty()
630 if (zbr->znode && ubifs_zn_dirty(zbr->znode)) in find_next_dirty()
631 return find_first_dirty(zbr->znode); in find_next_dirty()
633 return znode; in find_next_dirty()
644 struct ubifs_znode *znode, *cnext; in get_znodes_to_commit() local
647 c->cnext = find_first_dirty(c->zroot.znode); in get_znodes_to_commit()
648 znode = c->enext = c->cnext; in get_znodes_to_commit()
649 if (!znode) { in get_znodes_to_commit()
655 ubifs_assert(c, !ubifs_zn_cow(znode)); in get_znodes_to_commit()
656 __set_bit(COW_ZNODE, &znode->flags); in get_znodes_to_commit()
657 znode->alt = 0; in get_znodes_to_commit()
658 cnext = find_next_dirty(znode); in get_znodes_to_commit()
660 znode->cnext = c->cnext; in get_znodes_to_commit()
663 znode->cparent = znode->parent; in get_znodes_to_commit()
664 znode->ciip = znode->iip; in get_znodes_to_commit()
665 znode->cnext = cnext; in get_znodes_to_commit()
666 znode = cnext; in get_znodes_to_commit()
827 struct ubifs_znode *znode, *cnext; in write_index() local
862 znode = cnext; in write_index()
867 idx->child_cnt = cpu_to_le16(znode->child_cnt); in write_index()
868 idx->level = cpu_to_le16(znode->level); in write_index()
869 for (i = 0; i < znode->child_cnt; i++) { in write_index()
871 struct ubifs_zbranch *zbr = &znode->zbranch[i]; in write_index()
880 ubifs_dump_znode(c, znode); in write_index()
881 if (zbr->znode) in write_index()
882 ubifs_dump_znode(c, zbr->znode); in write_index()
887 len = ubifs_idx_node_sz(c, znode->child_cnt); in write_index()
893 if (znode->cparent) in write_index()
895 znode->cparent->zbranch[znode->ciip].hash); in write_index()
897 if (znode->parent) { in write_index()
898 if (!ubifs_zn_obsolete(znode)) in write_index()
900 znode->parent->zbranch[znode->iip].hash); in write_index()
916 if (lnum != znode->lnum || offs != znode->offs || in write_index()
917 len != znode->len) { in write_index()
923 cnext = znode->cnext; in write_index()
925 ubifs_assert(c, ubifs_zn_dirty(znode)); in write_index()
926 ubifs_assert(c, ubifs_zn_cow(znode)); in write_index()
936 clear_bit(DIRTY_ZNODE, &znode->flags); in write_index()
938 clear_bit(COW_ZNODE, &znode->flags); in write_index()
1034 struct ubifs_znode *znode, *cnext; in free_obsolete_znodes() local
1038 znode = cnext; in free_obsolete_znodes()
1039 cnext = znode->cnext; in free_obsolete_znodes()
1040 if (ubifs_zn_obsolete(znode)) in free_obsolete_znodes()
1041 kfree(znode); in free_obsolete_znodes()
1043 znode->cnext = NULL; in free_obsolete_znodes()
1100 dbg_cmt("TNC height is %d", c->zroot.znode->level + 1); in ubifs_tnc_end_commit()