Lines Matching refs:jeb

24 static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_…
25 static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
26 static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
29 struct jffs2_eraseblock *jeb) in jffs2_erase_block() argument
34 ret = jffs2_flash_erase(c, jeb); in jffs2_erase_block()
36 jffs2_erase_succeeded(c, jeb); in jffs2_erase_block()
39 bad_offset = jeb->offset; in jffs2_erase_block()
45 jeb->offset, jeb->offset, jeb->offset + c->sector_size); in jffs2_erase_block()
51 list_move(&jeb->list, &c->erase_pending_list); in jffs2_erase_block()
54 jeb->dirty_size = c->sector_size; in jffs2_erase_block()
62 instr->addr = jeb->offset; in jffs2_erase_block()
67 jffs2_erase_succeeded(c, jeb); in jffs2_erase_block()
79 jeb->offset, ret); in jffs2_erase_block()
82 list_move(&jeb->list, &c->erase_pending_list); in jffs2_erase_block()
85 jeb->dirty_size = c->sector_size; in jffs2_erase_block()
93 jeb->offset); in jffs2_erase_block()
96 jeb->offset, ret); in jffs2_erase_block()
98 jffs2_erase_failed(c, jeb, bad_offset); in jffs2_erase_block()
103 struct jffs2_eraseblock *jeb; in jffs2_erase_pending_blocks() local
114 jeb = list_entry(c->erase_complete_list.next, struct jffs2_eraseblock, list); in jffs2_erase_pending_blocks()
115 list_move(&jeb->list, &c->erase_checking_list); in jffs2_erase_pending_blocks()
118 jffs2_mark_erased_block(c, jeb); in jffs2_erase_pending_blocks()
127 jeb = list_entry(c->erase_pending_list.next, struct jffs2_eraseblock, list); in jffs2_erase_pending_blocks()
129 jeb->offset); in jffs2_erase_pending_blocks()
130 list_del(&jeb->list); in jffs2_erase_pending_blocks()
132 c->wasted_size -= jeb->wasted_size; in jffs2_erase_pending_blocks()
133 c->free_size -= jeb->free_size; in jffs2_erase_pending_blocks()
134 c->used_size -= jeb->used_size; in jffs2_erase_pending_blocks()
135 c->dirty_size -= jeb->dirty_size; in jffs2_erase_pending_blocks()
136 jeb->wasted_size = jeb->used_size = jeb->dirty_size = jeb->free_size = 0; in jffs2_erase_pending_blocks()
137 jffs2_free_jeb_node_refs(c, jeb); in jffs2_erase_pending_blocks()
138 list_add(&jeb->list, &c->erasing_list); in jffs2_erase_pending_blocks()
142 jffs2_erase_block(c, jeb); in jffs2_erase_pending_blocks()
161 static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) in jffs2_erase_succeeded() argument
163 jffs2_dbg(1, "Erase completed successfully at 0x%08x\n", jeb->offset); in jffs2_erase_succeeded()
166 list_move_tail(&jeb->list, &c->erase_complete_list); in jffs2_erase_succeeded()
174 static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_… in jffs2_erase_failed() argument
181 if (!jffs2_write_nand_badblock(c, jeb, bad_offset)) { in jffs2_erase_failed()
185 list_move(&jeb->list, &c->erase_pending_list); in jffs2_erase_failed()
188 jeb->dirty_size = c->sector_size; in jffs2_erase_failed()
199 list_move(&jeb->list, &c->bad_list); in jffs2_erase_failed()
209 struct jffs2_raw_node_ref *ref, struct jffs2_eraseblock *jeb) in jffs2_remove_node_refs_from_ino_list() argument
227 if (SECTOR_ADDR((*prev)->flash_offset) == jeb->offset) { in jffs2_remove_node_refs_from_ino_list()
252 jeb->offset, jeb->offset + c->sector_size, ic->ino); in jffs2_remove_node_refs_from_ino_list()
289 void jffs2_free_jeb_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) in jffs2_free_jeb_node_refs() argument
293 jeb->offset); in jffs2_free_jeb_node_refs()
295 block = ref = jeb->first_node; in jffs2_free_jeb_node_refs()
305 jffs2_remove_node_refs_from_ino_list(c, ref, jeb); in jffs2_free_jeb_node_refs()
310 jeb->first_node = jeb->last_node = NULL; in jffs2_free_jeb_node_refs()
313 static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t … in jffs2_block_check_erase() argument
321 ret = mtd_point(c->mtd, jeb->offset, c->sector_size, &retlen, in jffs2_block_check_erase()
332 mtd_unpoint(c->mtd, jeb->offset, retlen); in jffs2_block_check_erase()
341 mtd_unpoint(c->mtd, jeb->offset, c->sector_size); in jffs2_block_check_erase()
345 jeb->offset + in jffs2_block_check_erase()
355 jeb->offset); in jffs2_block_check_erase()
359 jffs2_dbg(1, "Verifying erase at 0x%08x\n", jeb->offset); in jffs2_block_check_erase()
361 for (ofs = jeb->offset; ofs < jeb->offset + c->sector_size; ) { in jffs2_block_check_erase()
362 uint32_t readlen = min((uint32_t)PAGE_SIZE, jeb->offset + c->sector_size - ofs); in jffs2_block_check_erase()
400 static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) in jffs2_mark_erased_block() argument
406 switch (jffs2_block_check_erase(c, jeb, &bad_offset)) { in jffs2_mark_erased_block()
412 jffs2_dbg(1, "Writing erased marker to block at 0x%08x\n", jeb->offset); in jffs2_mark_erased_block()
413 bad_offset = jeb->offset; in jffs2_mark_erased_block()
419 if (jffs2_write_nand_cleanmarker(c, jeb)) in jffs2_mark_erased_block()
431 jffs2_prealloc_raw_node_refs(c, jeb, 1); in jffs2_mark_erased_block()
437 ret = jffs2_flash_direct_writev(c, vecs, 1, jeb->offset, &retlen); in jffs2_mark_erased_block()
442 jeb->offset, ret); in jffs2_mark_erased_block()
445 jeb->offset, sizeof(marker), retlen); in jffs2_mark_erased_block()
451 jeb->free_size = c->sector_size; in jffs2_mark_erased_block()
461 jffs2_link_node_ref(c, jeb, jeb->offset | REF_NORMAL, c->cleanmarker_size, NULL); in jffs2_mark_erased_block()
463 list_move_tail(&jeb->list, &c->free_list); in jffs2_mark_erased_block()
467 jffs2_dbg_acct_sanity_check_nolock(c, jeb); in jffs2_mark_erased_block()
468 jffs2_dbg_acct_paranoia_check_nolock(c, jeb); in jffs2_mark_erased_block()
476 jffs2_erase_failed(c, jeb, bad_offset); in jffs2_mark_erased_block()
484 list_move(&jeb->list, &c->erase_complete_list); in jffs2_mark_erased_block()