• Home
  • Raw
  • Download

Lines Matching refs:jeb

237 static void jffs2_close_nextblock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)  in jffs2_close_nextblock()  argument
242 __func__, jeb->offset); in jffs2_close_nextblock()
246 if (ISDIRTY (jeb->wasted_size + jeb->dirty_size)) { in jffs2_close_nextblock()
247 c->dirty_size += jeb->wasted_size; in jffs2_close_nextblock()
248 c->wasted_size -= jeb->wasted_size; in jffs2_close_nextblock()
249 jeb->dirty_size += jeb->wasted_size; in jffs2_close_nextblock()
250 jeb->wasted_size = 0; in jffs2_close_nextblock()
251 if (VERYDIRTY(c, jeb->dirty_size)) { in jffs2_close_nextblock()
253 jeb->offset, jeb->free_size, jeb->dirty_size, in jffs2_close_nextblock()
254 jeb->used_size); in jffs2_close_nextblock()
255 list_add_tail(&jeb->list, &c->very_dirty_list); in jffs2_close_nextblock()
258 jeb->offset, jeb->free_size, jeb->dirty_size, in jffs2_close_nextblock()
259 jeb->used_size); in jffs2_close_nextblock()
260 list_add_tail(&jeb->list, &c->dirty_list); in jffs2_close_nextblock()
264 jeb->offset, jeb->free_size, jeb->dirty_size, in jffs2_close_nextblock()
265 jeb->used_size); in jffs2_close_nextblock()
266 list_add_tail(&jeb->list, &c->clean_list); in jffs2_close_nextblock()
351 struct jffs2_eraseblock *jeb = c->nextblock; in jffs2_do_reserve_space() local
361 if (jeb) { in jffs2_do_reserve_space()
365 minsize, jeb->free_size, in jffs2_do_reserve_space()
371 if (jeb && (PAD(minsize) + PAD(c->summary->sum_size + sumsize + in jffs2_do_reserve_space()
372 JFFS2_SUMMARY_FRAME_SIZE) > jeb->free_size)) { in jffs2_do_reserve_space()
381 dbg_summary("generating summary for 0x%08x.\n", jeb->offset); in jffs2_do_reserve_space()
395 jffs2_close_nextblock(c, jeb); in jffs2_do_reserve_space()
396 jeb = NULL; in jffs2_do_reserve_space()
401 if (jeb && minsize > jeb->free_size) { in jffs2_do_reserve_space()
413 jeb = c->nextblock; in jffs2_do_reserve_space()
419 ret = jffs2_prealloc_raw_node_refs(c, jeb, 1); in jffs2_do_reserve_space()
430 waste = jeb->free_size; in jffs2_do_reserve_space()
431 jffs2_link_node_ref(c, jeb, in jffs2_do_reserve_space()
432 (jeb->offset + c->sector_size - waste) | REF_OBSOLETE, in jffs2_do_reserve_space()
435 jeb->dirty_size -= waste; in jffs2_do_reserve_space()
437 jeb->wasted_size += waste; in jffs2_do_reserve_space()
440 jffs2_close_nextblock(c, jeb); in jffs2_do_reserve_space()
441 jeb = NULL; in jffs2_do_reserve_space()
445 if (!jeb) { in jffs2_do_reserve_space()
451 jeb = c->nextblock; in jffs2_do_reserve_space()
453 if (jeb->free_size != c->sector_size - c->cleanmarker_size) { in jffs2_do_reserve_space()
455 jeb->offset, jeb->free_size); in jffs2_do_reserve_space()
461 *len = jeb->free_size - reserved_size; in jffs2_do_reserve_space()
463 if (c->cleanmarker_size && jeb->used_size == c->cleanmarker_size && in jffs2_do_reserve_space()
464 !jeb->first_node->next_in_ino) { in jffs2_do_reserve_space()
472 jffs2_mark_node_obsolete(c, jeb->first_node); in jffs2_do_reserve_space()
478 *len, jeb->offset + (c->sector_size - jeb->free_size)); in jffs2_do_reserve_space()
498 struct jffs2_eraseblock *jeb; in jffs2_add_physical_node_ref() local
501 jeb = &c->blocks[ofs / c->sector_size]; in jffs2_add_physical_node_ref()
510 && (jeb != c->nextblock || (ofs & ~3) != jeb->offset + (c->sector_size - jeb->free_size))) { in jffs2_add_physical_node_ref()
518 jeb->offset + (c->sector_size - jeb->free_size)); in jffs2_add_physical_node_ref()
524 new = jffs2_link_node_ref(c, jeb, ofs, len, ic); in jffs2_add_physical_node_ref()
526 if (!jeb->free_size && !jeb->dirty_size && !ISDIRTY(jeb->wasted_size)) { in jffs2_add_physical_node_ref()
529 jeb->offset, jeb->free_size, jeb->dirty_size, in jffs2_add_physical_node_ref()
530 jeb->used_size); in jffs2_add_physical_node_ref()
538 list_add_tail(&jeb->list, &c->clean_list); in jffs2_add_physical_node_ref()
541 jffs2_dbg_acct_sanity_check_nolock(c,jeb); in jffs2_add_physical_node_ref()
542 jffs2_dbg_acct_paranoia_check_nolock(c, jeb); in jffs2_add_physical_node_ref()
575 struct jffs2_eraseblock *jeb; in jffs2_mark_node_obsolete() local
597 jeb = &c->blocks[blocknr]; in jffs2_mark_node_obsolete()
612 freed_len = ref_totlen(c, jeb, ref); in jffs2_mark_node_obsolete()
615 D1(if (unlikely(jeb->unchecked_size < freed_len)) { in jffs2_mark_node_obsolete()
618 ref->flash_offset, jeb->used_size); in jffs2_mark_node_obsolete()
623 jeb->unchecked_size -= freed_len; in jffs2_mark_node_obsolete()
626 D1(if (unlikely(jeb->used_size < freed_len)) { in jffs2_mark_node_obsolete()
629 ref->flash_offset, jeb->used_size); in jffs2_mark_node_obsolete()
634 jeb->used_size -= freed_len; in jffs2_mark_node_obsolete()
639 if ((jeb->dirty_size || ISDIRTY(jeb->wasted_size + freed_len)) && jeb != c->nextblock) { in jffs2_mark_node_obsolete()
642 jeb->dirty_size += freed_len; in jffs2_mark_node_obsolete()
646 if (jeb->wasted_size) { in jffs2_mark_node_obsolete()
647 if (on_list(&jeb->list, &c->bad_used_list)) { in jffs2_mark_node_obsolete()
649 jeb->offset); in jffs2_mark_node_obsolete()
653 jeb->wasted_size, jeb->offset); in jffs2_mark_node_obsolete()
654 addedsize += jeb->wasted_size; in jffs2_mark_node_obsolete()
655 jeb->dirty_size += jeb->wasted_size; in jffs2_mark_node_obsolete()
656 c->dirty_size += jeb->wasted_size; in jffs2_mark_node_obsolete()
657 c->wasted_size -= jeb->wasted_size; in jffs2_mark_node_obsolete()
658 jeb->wasted_size = 0; in jffs2_mark_node_obsolete()
664 jeb->wasted_size += freed_len; in jffs2_mark_node_obsolete()
669 jffs2_dbg_acct_sanity_check_nolock(c, jeb); in jffs2_mark_node_obsolete()
670 jffs2_dbg_acct_paranoia_check_nolock(c, jeb); in jffs2_mark_node_obsolete()
683 if (jeb == c->nextblock) { in jffs2_mark_node_obsolete()
685 jeb->offset); in jffs2_mark_node_obsolete()
686 } else if (!jeb->used_size && !jeb->unchecked_size) { in jffs2_mark_node_obsolete()
687 if (jeb == c->gcblock) { in jffs2_mark_node_obsolete()
689 jeb->offset); in jffs2_mark_node_obsolete()
693 jeb->offset); in jffs2_mark_node_obsolete()
694 list_del(&jeb->list); in jffs2_mark_node_obsolete()
698 list_add_tail(&jeb->list, &c->erasable_pending_wbuf_list); in jffs2_mark_node_obsolete()
704 list_add_tail(&jeb->list, &c->erase_pending_list); in jffs2_mark_node_obsolete()
711 list_add_tail(&jeb->list, &c->erasable_list); in jffs2_mark_node_obsolete()
715 } else if (jeb == c->gcblock) { in jffs2_mark_node_obsolete()
717 jeb->offset); in jffs2_mark_node_obsolete()
718 } else if (ISDIRTY(jeb->dirty_size) && !ISDIRTY(jeb->dirty_size - addedsize)) { in jffs2_mark_node_obsolete()
720 jeb->offset); in jffs2_mark_node_obsolete()
721 list_del(&jeb->list); in jffs2_mark_node_obsolete()
723 list_add_tail(&jeb->list, &c->dirty_list); in jffs2_mark_node_obsolete()
724 } else if (VERYDIRTY(c, jeb->dirty_size) && in jffs2_mark_node_obsolete()
725 !VERYDIRTY(c, jeb->dirty_size - addedsize)) { in jffs2_mark_node_obsolete()
727 jeb->offset); in jffs2_mark_node_obsolete()
728 list_del(&jeb->list); in jffs2_mark_node_obsolete()
730 list_add_tail(&jeb->list, &c->very_dirty_list); in jffs2_mark_node_obsolete()
733 jeb->offset, jeb->free_size, jeb->dirty_size, in jffs2_mark_node_obsolete()
734 jeb->used_size); in jffs2_mark_node_obsolete()
836 struct jffs2_eraseblock *jeb; in jffs2_thread_should_wake() local
862 list_for_each_entry(jeb, &c->very_dirty_list, list) { in jffs2_thread_should_wake()