Lines Matching refs:jeb
117 struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list); in jffs2_refile_wbuf_blocks() local
120 jeb->offset); in jffs2_refile_wbuf_blocks()
126 list_add_tail(&jeb->list, &c->erase_pending_list); in jffs2_refile_wbuf_blocks()
133 list_add_tail(&jeb->list, &c->erasable_list); in jffs2_refile_wbuf_blocks()
141 static void jffs2_block_refile(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, int allow_emp… in jffs2_block_refile() argument
143 jffs2_dbg(1, "About to refile bad block at %08x\n", jeb->offset); in jffs2_block_refile()
146 if (c->nextblock == jeb) in jffs2_block_refile()
149 list_del(&jeb->list); in jffs2_block_refile()
150 if (jeb->first_node) { in jffs2_block_refile()
152 jeb->offset); in jffs2_block_refile()
153 list_add(&jeb->list, &c->bad_used_list); in jffs2_block_refile()
158 jeb->offset); in jffs2_block_refile()
159 list_add(&jeb->list, &c->erase_pending_list); in jffs2_block_refile()
164 if (!jffs2_prealloc_raw_node_refs(c, jeb, 1)) { in jffs2_block_refile()
165 uint32_t oldfree = jeb->free_size; in jffs2_block_refile()
167 jffs2_link_node_ref(c, jeb, in jffs2_block_refile()
168 (jeb->offset+c->sector_size-oldfree) | REF_OBSOLETE, in jffs2_block_refile()
172 jeb->wasted_size += oldfree; in jffs2_block_refile()
174 jeb->dirty_size -= oldfree; in jffs2_block_refile()
178 jffs2_dbg_acct_sanity_check_nolock(c,jeb); in jffs2_block_refile()
179 jffs2_dbg_acct_paranoia_check_nolock(c, jeb); in jffs2_block_refile()
277 struct jffs2_eraseblock *jeb, *new_jeb; in jffs2_wbuf_recover() local
285 jeb = &c->blocks[c->wbuf_ofs / c->sector_size]; in jffs2_wbuf_recover()
289 jffs2_block_refile(c, jeb, REFILE_NOTEMPTY); in jffs2_wbuf_recover()
291 jffs2_block_refile(c, jeb, REFILE_ANYWAY); in jffs2_wbuf_recover()
294 BUG_ON(!ref_obsolete(jeb->last_node)); in jffs2_wbuf_recover()
298 for (next = raw = jeb->first_node; next; raw = next) { in jffs2_wbuf_recover()
305 (ref_offset(raw) + ref_totlen(c, jeb, raw)), in jffs2_wbuf_recover()
311 (ref_offset(raw) + ref_totlen(c, jeb, raw))); in jffs2_wbuf_recover()
325 end = ref_offset(jeb->last_node); in jffs2_wbuf_recover()
329 while ((raw = ref_next(raw)) != jeb->last_node) in jffs2_wbuf_recover()
438 jffs2_add_physical_node_ref(c, ofs | REF_OBSOLETE, ref_totlen(c, jeb, first_raw), NULL); in jffs2_wbuf_recover()
463 for (raw = first_raw; raw != jeb->last_node; raw = ref_next(raw)) { in jffs2_wbuf_recover()
464 uint32_t rawlen = ref_totlen(c, jeb, raw); in jffs2_wbuf_recover()
537 jeb->dirty_size += rawlen; in jffs2_wbuf_recover()
538 jeb->used_size -= rawlen; in jffs2_wbuf_recover()
550 if (first_raw == jeb->first_node) { in jffs2_wbuf_recover()
552 jeb->offset); in jffs2_wbuf_recover()
553 list_move(&jeb->list, &c->erase_pending_list); in jffs2_wbuf_recover()
558 jffs2_dbg_acct_sanity_check_nolock(c, jeb); in jffs2_wbuf_recover()
559 jffs2_dbg_acct_paranoia_check_nolock(c, jeb); in jffs2_wbuf_recover()
798 struct jffs2_eraseblock *jeb; in jffs2_flash_writev() local
926 jeb = &c->blocks[outvec_to / c->sector_size]; in jffs2_flash_writev()
927 jffs2_block_refile(c, jeb, REFILE_ANYWAY); in jffs2_flash_writev()
1034 struct jffs2_eraseblock *jeb, int mode) in jffs2_check_oob_empty() argument
1046 ret = mtd_read_oob(c->mtd, jeb->offset, &ops); in jffs2_check_oob_empty()
1049 jeb->offset, ops.ooblen, ops.oobretlen, ret); in jffs2_check_oob_empty()
1062 "%08x\n", ops.oobbuf[i], i, jeb->offset); in jffs2_check_oob_empty()
1077 struct jffs2_eraseblock *jeb) in jffs2_check_nand_cleanmarker() argument
1088 ret = mtd_read_oob(c->mtd, jeb->offset, &ops); in jffs2_check_nand_cleanmarker()
1091 jeb->offset, ops.ooblen, ops.oobretlen, ret); in jffs2_check_nand_cleanmarker()
1101 struct jffs2_eraseblock *jeb) in jffs2_write_nand_cleanmarker() argument
1113 ret = mtd_write_oob(c->mtd, jeb->offset, &ops); in jffs2_write_nand_cleanmarker()
1116 jeb->offset, ops.ooblen, ops.oobretlen, ret); in jffs2_write_nand_cleanmarker()
1133 int jffs2_write_nand_badblock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_o… in jffs2_write_nand_badblock() argument
1138 if( ++jeb->bad_count < MAX_ERASE_FAILURES) in jffs2_write_nand_badblock()
1146 __func__, jeb->offset, ret); in jffs2_write_nand_badblock()