Lines Matching refs:frag
61 struct jffs2_node_frag *frag = jffs2_lookup_node_frag(list, size); in jffs2_truncate_fragtree() local
66 if (frag && frag->ofs != size) { in jffs2_truncate_fragtree()
67 if (frag->ofs+frag->size > size) { in jffs2_truncate_fragtree()
68 frag->size = size - frag->ofs; in jffs2_truncate_fragtree()
70 frag = frag_next(frag); in jffs2_truncate_fragtree()
72 while (frag && frag->ofs >= size) { in jffs2_truncate_fragtree()
73 struct jffs2_node_frag *next = frag_next(frag); in jffs2_truncate_fragtree()
75 frag_erase(frag, list); in jffs2_truncate_fragtree()
76 jffs2_obsolete_node_frag(c, frag); in jffs2_truncate_fragtree()
77 frag = next; in jffs2_truncate_fragtree()
83 frag = frag_last(list); in jffs2_truncate_fragtree()
86 if (!frag) in jffs2_truncate_fragtree()
88 if (frag->ofs + frag->size < size) in jffs2_truncate_fragtree()
89 return frag->ofs + frag->size; in jffs2_truncate_fragtree()
93 if (frag->node && (frag->ofs & (PAGE_SIZE - 1)) == 0) { in jffs2_truncate_fragtree()
95 frag->ofs, frag->ofs + frag->size); in jffs2_truncate_fragtree()
96 frag->node->raw->flash_offset = ref_offset(frag->node->raw) | REF_PRISTINE; in jffs2_truncate_fragtree()
530 struct jffs2_node_frag *frag = NULL; in jffs2_lookup_node_frag() local
537 frag = rb_entry(next, struct jffs2_node_frag, rb); in jffs2_lookup_node_frag()
539 if (frag->ofs + frag->size <= offset) { in jffs2_lookup_node_frag()
541 if (!prev || frag->ofs > prev->ofs) in jffs2_lookup_node_frag()
542 prev = frag; in jffs2_lookup_node_frag()
543 next = frag->rb.rb_right; in jffs2_lookup_node_frag()
544 } else if (frag->ofs > offset) { in jffs2_lookup_node_frag()
545 next = frag->rb.rb_left; in jffs2_lookup_node_frag()
547 return frag; in jffs2_lookup_node_frag()
567 struct jffs2_node_frag *frag, *next; in jffs2_kill_fragtree() local
570 rbtree_postorder_for_each_entry_safe(frag, next, root, rb) { in jffs2_kill_fragtree()
571 if (frag->node && !(--frag->node->frags)) { in jffs2_kill_fragtree()
575 jffs2_mark_node_obsolete(c, frag->node->raw); in jffs2_kill_fragtree()
577 jffs2_free_full_dnode(frag->node); in jffs2_kill_fragtree()
580 jffs2_free_node_frag(frag); in jffs2_kill_fragtree()