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()
60 instr->addr = jeb->offset; in jffs2_erase_block()
65 jffs2_erase_succeeded(c, jeb); in jffs2_erase_block()
77 jeb->offset, ret); in jffs2_erase_block()
80 list_move(&jeb->list, &c->erase_pending_list); in jffs2_erase_block()
83 jeb->dirty_size = c->sector_size; in jffs2_erase_block()
91 jeb->offset); in jffs2_erase_block()
94 jeb->offset, ret); in jffs2_erase_block()
96 jffs2_erase_failed(c, jeb, bad_offset); in jffs2_erase_block()
101 struct jffs2_eraseblock *jeb; in jffs2_erase_pending_blocks() local
112 jeb = list_entry(c->erase_complete_list.next, struct jffs2_eraseblock, list); in jffs2_erase_pending_blocks()
113 list_move(&jeb->list, &c->erase_checking_list); in jffs2_erase_pending_blocks()
116 jffs2_mark_erased_block(c, jeb); in jffs2_erase_pending_blocks()
125 jeb = list_entry(c->erase_pending_list.next, struct jffs2_eraseblock, list); in jffs2_erase_pending_blocks()
127 jeb->offset); in jffs2_erase_pending_blocks()
128 list_del(&jeb->list); in jffs2_erase_pending_blocks()
130 c->wasted_size -= jeb->wasted_size; in jffs2_erase_pending_blocks()
131 c->free_size -= jeb->free_size; in jffs2_erase_pending_blocks()
132 c->used_size -= jeb->used_size; in jffs2_erase_pending_blocks()
133 c->dirty_size -= jeb->dirty_size; in jffs2_erase_pending_blocks()
134 jeb->wasted_size = jeb->used_size = jeb->dirty_size = jeb->free_size = 0; in jffs2_erase_pending_blocks()
135 jffs2_free_jeb_node_refs(c, jeb); in jffs2_erase_pending_blocks()
136 list_add(&jeb->list, &c->erasing_list); in jffs2_erase_pending_blocks()
140 jffs2_erase_block(c, jeb); in jffs2_erase_pending_blocks()
159 static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) in jffs2_erase_succeeded() argument
161 jffs2_dbg(1, "Erase completed successfully at 0x%08x\n", jeb->offset); in jffs2_erase_succeeded()
164 list_move_tail(&jeb->list, &c->erase_complete_list); in jffs2_erase_succeeded()
172 static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_… in jffs2_erase_failed() argument
179 if (!jffs2_write_nand_badblock(c, jeb, bad_offset)) { in jffs2_erase_failed()
183 list_move(&jeb->list, &c->erase_pending_list); in jffs2_erase_failed()
186 jeb->dirty_size = c->sector_size; in jffs2_erase_failed()
197 list_move(&jeb->list, &c->bad_list); in jffs2_erase_failed()
207 struct jffs2_raw_node_ref *ref, struct jffs2_eraseblock *jeb) in jffs2_remove_node_refs_from_ino_list() argument
225 if (SECTOR_ADDR((*prev)->flash_offset) == jeb->offset) { in jffs2_remove_node_refs_from_ino_list()
250 jeb->offset, jeb->offset + c->sector_size, ic->ino); in jffs2_remove_node_refs_from_ino_list()
287 void jffs2_free_jeb_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) in jffs2_free_jeb_node_refs() argument
291 jeb->offset); in jffs2_free_jeb_node_refs()
293 block = ref = jeb->first_node; in jffs2_free_jeb_node_refs()
303 jffs2_remove_node_refs_from_ino_list(c, ref, jeb); in jffs2_free_jeb_node_refs()
308 jeb->first_node = jeb->last_node = NULL; in jffs2_free_jeb_node_refs()
311 static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t … in jffs2_block_check_erase() argument
319 ret = mtd_point(c->mtd, jeb->offset, c->sector_size, &retlen, in jffs2_block_check_erase()
330 mtd_unpoint(c->mtd, jeb->offset, retlen); in jffs2_block_check_erase()
339 mtd_unpoint(c->mtd, jeb->offset, c->sector_size); in jffs2_block_check_erase()
343 jeb->offset + in jffs2_block_check_erase()
353 jeb->offset); in jffs2_block_check_erase()
357 jffs2_dbg(1, "Verifying erase at 0x%08x\n", jeb->offset); in jffs2_block_check_erase()
359 for (ofs = jeb->offset; ofs < jeb->offset + c->sector_size; ) { in jffs2_block_check_erase()
360 uint32_t readlen = min((uint32_t)PAGE_SIZE, jeb->offset + c->sector_size - ofs); in jffs2_block_check_erase()
398 static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) in jffs2_mark_erased_block() argument
404 switch (jffs2_block_check_erase(c, jeb, &bad_offset)) { in jffs2_mark_erased_block()
410 jffs2_dbg(1, "Writing erased marker to block at 0x%08x\n", jeb->offset); in jffs2_mark_erased_block()
411 bad_offset = jeb->offset; in jffs2_mark_erased_block()
417 if (jffs2_write_nand_cleanmarker(c, jeb)) in jffs2_mark_erased_block()
429 jffs2_prealloc_raw_node_refs(c, jeb, 1); in jffs2_mark_erased_block()
435 ret = jffs2_flash_direct_writev(c, vecs, 1, jeb->offset, &retlen); in jffs2_mark_erased_block()
440 jeb->offset, ret); in jffs2_mark_erased_block()
443 jeb->offset, sizeof(marker), retlen); in jffs2_mark_erased_block()
449 jeb->free_size = c->sector_size; in jffs2_mark_erased_block()
459 jffs2_link_node_ref(c, jeb, jeb->offset | REF_NORMAL, c->cleanmarker_size, NULL); in jffs2_mark_erased_block()
461 list_move_tail(&jeb->list, &c->free_list); in jffs2_mark_erased_block()
465 jffs2_dbg_acct_sanity_check_nolock(c, jeb); in jffs2_mark_erased_block()
466 jffs2_dbg_acct_paranoia_check_nolock(c, jeb); in jffs2_mark_erased_block()
474 jffs2_erase_failed(c, jeb, bad_offset); in jffs2_mark_erased_block()
482 list_move(&jeb->list, &c->erase_complete_list); in jffs2_mark_erased_block()