Lines Matching refs:size
59 uint32_t jffs2_truncate_fragtree(struct jffs2_sb_info *c, struct rb_root *list, uint32_t size) in jffs2_truncate_fragtree() argument
61 struct jffs2_node_frag *frag = jffs2_lookup_node_frag(list, size); in jffs2_truncate_fragtree()
63 dbg_fragtree("truncating fragtree to 0x%08x bytes\n", size); in jffs2_truncate_fragtree()
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()
72 while (frag && frag->ofs >= size) { in jffs2_truncate_fragtree()
80 if (size == 0) 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()
95 frag->ofs, frag->ofs + frag->size); in jffs2_truncate_fragtree()
98 return size; in jffs2_truncate_fragtree()
109 ref_offset(this->node->raw), this->node->ofs, this->node->ofs+this->node->size); in jffs2_obsolete_node_frag()
114 …ref_offset(this->node->raw), this->node->ofs, this->node->ofs+this->node->size, this->node->frags); in jffs2_obsolete_node_frag()
127 dbg_fragtree2("insert frag (0x%04x-0x%04x)\n", newfrag->ofs, newfrag->ofs + newfrag->size); in jffs2_fragtree_insert()
149 …tic struct jffs2_node_frag * new_fragment(struct jffs2_full_dnode *fn, uint32_t ofs, uint32_t size) in new_fragment() argument
156 newfrag->size = size; in new_fragment()
188 holefrag->ofs, holefrag->ofs + holefrag->size); in no_overlapping_node()
192 holefrag->ofs, holefrag->ofs + holefrag->size); in no_overlapping_node()
225 this->ofs, this->ofs+this->size, this->node?(ref_offset(this->node->raw)):0xffffffff, this); in jffs2_add_frag_to_fragtree()
226 lastend = this->ofs + this->size; in jffs2_add_frag_to_fragtree()
251 this->ofs, this->ofs + this->size, in jffs2_add_frag_to_fragtree()
255 this->ofs, this->ofs + this->size); in jffs2_add_frag_to_fragtree()
269 if (this->ofs + this->size > newfrag->ofs + newfrag->size) { in jffs2_add_frag_to_fragtree()
275 this->ofs, this->ofs+this->size, ref_offset(this->node->raw)); in jffs2_add_frag_to_fragtree()
278 this->ofs, this->ofs+this->size); in jffs2_add_frag_to_fragtree()
281 newfrag2 = new_fragment(this->node, newfrag->ofs + newfrag->size, in jffs2_add_frag_to_fragtree()
282 this->ofs + this->size - newfrag->ofs - newfrag->size); in jffs2_add_frag_to_fragtree()
289 this->size = newfrag->ofs - this->ofs; in jffs2_add_frag_to_fragtree()
306 this->size = newfrag->ofs - this->ofs; in jffs2_add_frag_to_fragtree()
315 newfrag, newfrag->ofs, newfrag->ofs+newfrag->size, this, this->ofs, this->ofs+this->size); in jffs2_add_frag_to_fragtree()
319 if (newfrag->ofs + newfrag->size >= this->ofs+this->size) { in jffs2_add_frag_to_fragtree()
320 dbg_fragtree2("obsoleting node frag %p (%x-%x)\n", this, this->ofs, this->ofs+this->size); in jffs2_add_frag_to_fragtree()
323 this->ofs += newfrag->size; in jffs2_add_frag_to_fragtree()
324 this->size -= newfrag->size; in jffs2_add_frag_to_fragtree()
334 while ((this = frag_next(newfrag)) && newfrag->ofs + newfrag->size >= this->ofs + this->size) { in jffs2_add_frag_to_fragtree()
337 this, this->ofs, this->ofs+this->size); in jffs2_add_frag_to_fragtree()
344 if (!this || newfrag->ofs + newfrag->size == this->ofs) in jffs2_add_frag_to_fragtree()
348 this->size = (this->ofs + this->size) - (newfrag->ofs + newfrag->size); in jffs2_add_frag_to_fragtree()
349 this->ofs = newfrag->ofs + newfrag->size; in jffs2_add_frag_to_fragtree()
368 if (unlikely(!fn->size)) in jffs2_add_full_dnode_to_inode()
371 newfrag = new_fragment(fn, fn->ofs, fn->size); in jffs2_add_full_dnode_to_inode()
377 fn->ofs, fn->ofs+fn->size, ref_offset(fn->raw), newfrag); in jffs2_add_full_dnode_to_inode()
394 if ((newfrag->ofs+newfrag->size) & (PAGE_SIZE-1)) { in jffs2_add_full_dnode_to_inode()
539 if (frag->ofs + frag->size <= offset) { in jffs2_lookup_node_frag()
556 prev->ofs, prev->ofs+prev->size); in jffs2_lookup_node_frag()
663 uint32_t size) in jffs2_scan_dirty_space() argument
665 if (!size) in jffs2_scan_dirty_space()
667 if (unlikely(size > jeb->free_size)) { in jffs2_scan_dirty_space()
669 size, jeb->free_size, jeb->wasted_size); in jffs2_scan_dirty_space()
675 jeb->last_node->__totlen += size; in jffs2_scan_dirty_space()
677 c->dirty_size += size; in jffs2_scan_dirty_space()
678 c->free_size -= size; in jffs2_scan_dirty_space()
679 jeb->dirty_size += size; in jffs2_scan_dirty_space()
680 jeb->free_size -= size; in jffs2_scan_dirty_space()
685 jffs2_link_node_ref(c, jeb, ofs, size, NULL); in jffs2_scan_dirty_space()