Lines Matching refs:blocks
88 struct block *blocks; member
95 struct block *block = &part->blocks[block_no]; in build_block_map()
188 part->blocks = kcalloc(part->total_blocks, sizeof(struct block), in scan_header()
190 if (!part->blocks) in scan_header()
235 kfree(part->blocks); in scan_header()
277 erase->addr = part->blocks[block].offset; in erase_block()
280 part->blocks[block].state = BLOCK_ERASING; in erase_block()
281 part->blocks[block].free_sectors = 0; in erase_block()
288 part->blocks[block].state = BLOCK_FAILED; in erase_block()
289 part->blocks[block].free_sectors = 0; in erase_block()
290 part->blocks[block].used_sectors = 0; in erase_block()
295 part->blocks[block].state = BLOCK_ERASED; in erase_block()
296 part->blocks[block].free_sectors = part->data_sectors_per_block; in erase_block()
297 part->blocks[block].used_sectors = 0; in erase_block()
298 part->blocks[block].erases++; in erase_block()
300 rc = mtd_write(part->mbd.mtd, part->blocks[block].offset, in erase_block()
307 part->mbd.mtd->name, part->blocks[block].offset); in erase_block()
308 part->blocks[block].state = BLOCK_FAILED; in erase_block()
310 part->blocks[block].state = BLOCK_OK; in erase_block()
336 rc = mtd_read(part->mbd.mtd, part->blocks[block_no].offset, in move_block_contents()
345 part->blocks[block_no].offset); in move_block_contents()
365 addr = part->blocks[block_no].offset + in move_block_contents()
370 if (!part->blocks[block_no].used_sectors--) { in move_block_contents()
433 if (part->blocks[block].free_sectors) in reclaim_block()
436 this_score = part->blocks[block].used_sectors; in reclaim_block()
442 if (part->blocks[block].used_sectors == in reclaim_block()
447 this_score += part->blocks[block].erases; in reclaim_block()
463 part->blocks[best_block].used_sectors, in reclaim_block()
464 part->blocks[best_block].free_sectors); in reclaim_block()
466 if (part->blocks[best_block].used_sectors) in reclaim_block()
488 if (part->blocks[block].free_sectors && in find_free_block()
492 if (part->blocks[block].state == BLOCK_UNUSED) in find_free_block()
525 rc = mtd_read(part->mbd.mtd, part->blocks[block].offset, in find_writable_block()
535 part->blocks[block].offset); in find_writable_block()
556 addr = part->blocks[block].offset + in mark_sector_deleted()
572 part->blocks[block].used_sectors--; in mark_sector_deleted()
574 if (!part->blocks[block].used_sectors && in mark_sector_deleted()
575 !part->blocks[block].free_sectors) in mark_sector_deleted()
612 !part->blocks[part->current_block].free_sectors) { in do_writesect()
619 block = &part->blocks[part->current_block]; in do_writesect()
800 part->mbd.mtd->name, i, part->blocks[i].erases); in rfd_ftl_remove_dev()
805 kfree(part->blocks); in rfd_ftl_remove_dev()