Lines Matching refs:jeb
610 struct jffs2_eraseblock *jeb, in jffs2_link_node_ref() argument
616 BUG_ON(!jeb->allocated_refs); in jffs2_link_node_ref()
617 jeb->allocated_refs--; in jffs2_link_node_ref()
619 ref = jeb->last_node; in jffs2_link_node_ref()
636 if (!jeb->first_node) { in jffs2_link_node_ref()
637 jeb->first_node = ref; in jffs2_link_node_ref()
638 BUG_ON(ref_offset(ref) != jeb->offset); in jffs2_link_node_ref()
639 } else if (unlikely(ref_offset(ref) != jeb->offset + c->sector_size - jeb->free_size)) { in jffs2_link_node_ref()
640 uint32_t last_len = ref_totlen(c, jeb, jeb->last_node); in jffs2_link_node_ref()
644 ref_offset(jeb->last_node), in jffs2_link_node_ref()
645 ref_offset(jeb->last_node)+last_len); in jffs2_link_node_ref()
648 jeb->last_node = ref; in jffs2_link_node_ref()
660 jeb->unchecked_size += len; in jffs2_link_node_ref()
666 jeb->used_size += len; in jffs2_link_node_ref()
671 jeb->dirty_size += len; in jffs2_link_node_ref()
675 jeb->free_size -= len; in jffs2_link_node_ref()
680 ref_totlen(c, jeb, ref); in jffs2_link_node_ref()
686 int jffs2_scan_dirty_space(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, in jffs2_scan_dirty_space() argument
691 if (unlikely(size > jeb->free_size)) { in jffs2_scan_dirty_space()
693 size, jeb->free_size, jeb->wasted_size); in jffs2_scan_dirty_space()
697 if (jeb->last_node && ref_obsolete(jeb->last_node)) { in jffs2_scan_dirty_space()
699 jeb->last_node->__totlen += size; in jffs2_scan_dirty_space()
703 jeb->dirty_size += size; in jffs2_scan_dirty_space()
704 jeb->free_size -= size; in jffs2_scan_dirty_space()
706 uint32_t ofs = jeb->offset + c->sector_size - jeb->free_size; in jffs2_scan_dirty_space()
709 jffs2_link_node_ref(c, jeb, ofs, size, NULL); in jffs2_scan_dirty_space()
717 struct jffs2_eraseblock *jeb, in __ref_totlen() argument
726 if (!jeb) in __ref_totlen()
727 jeb = &c->blocks[ref->flash_offset / c->sector_size]; in __ref_totlen()
730 if (unlikely(ref != jeb->last_node)) { in __ref_totlen()
732 ref, ref_offset(ref), jeb->last_node, in __ref_totlen()
733 jeb->last_node ? in __ref_totlen()
734 ref_offset(jeb->last_node) : 0); in __ref_totlen()
737 ref_end = jeb->offset + c->sector_size - jeb->free_size; in __ref_totlen()
742 uint32_t __jffs2_ref_totlen(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, in __jffs2_ref_totlen() argument
747 ret = __ref_totlen(c, jeb, ref); in __jffs2_ref_totlen()
751 if (!jeb) in __jffs2_ref_totlen()
752 jeb = &c->blocks[ref->flash_offset / c->sector_size]; in __jffs2_ref_totlen()
763 jeb->last_node); in __jffs2_ref_totlen()
766 jeb->wasted_size, jeb->dirty_size, jeb->used_size, in __jffs2_ref_totlen()
767 jeb->free_size); in __jffs2_ref_totlen()
770 __jffs2_dbg_dump_node_refs_nolock(c, jeb); in __jffs2_ref_totlen()