Lines Matching refs:block
35 unsigned int i, block; in find_boot_record() local
55 for (block = 0; block < inftl->nb_blocks; block++) { in find_boot_record()
62 ret = mtd_read(mtd, block * inftl->EraseSize, SECTORSIZE, in find_boot_record()
72 block * inftl->EraseSize, in find_boot_record()
89 block * inftl->EraseSize + SECTORSIZE + 8, in find_boot_record()
94 "(err %d)\n", block * inftl->EraseSize, in find_boot_record()
107 mtd_read(mtd, block * inftl->EraseSize + 4096, SECTORSIZE, in find_boot_record()
172 block >>= mh->BlockMultiplierBits; in find_boot_record()
280 inftl->PUtable[block] = BLOCK_RESERVED; in find_boot_record()
294 inftl->MediaUnit = block; in find_boot_record()
361 int INFTL_formatblock(struct INFTLrecord *inftl, int block) in INFTL_formatblock() argument
369 pr_debug("INFTL: INFTL_formatblock(inftl=%p,block=%d)\n", inftl, block); in INFTL_formatblock()
377 instr->addr = block * inftl->EraseSize; in INFTL_formatblock()
389 block); in INFTL_formatblock()
408 instr->addr = block * inftl->EraseSize + SECTORSIZE * 2; in INFTL_formatblock()
429 unsigned int block = first_block, block1; in format_chain() local
435 block1 = inftl->PUtable[block]; in format_chain()
437 printk(KERN_WARNING "INFTL: formatting block %d\n", block); in format_chain()
438 if (INFTL_formatblock(inftl, block) < 0) { in format_chain()
442 inftl->PUtable[block] = BLOCK_RESERVED; in format_chain()
444 inftl->PUtable[block] = BLOCK_FREE; in format_chain()
448 block = block1; in format_chain()
450 if (block == BLOCK_NIL || block >= inftl->lastEUN) in format_chain()
502 int logical, block, i; in INFTL_dumpVUchains() local
509 block = s->VUtable[logical]; in INFTL_dumpVUchains()
510 if (block >= s->nb_blocks) in INFTL_dumpVUchains()
512 pr_debug(" LOGICAL %d --> %d ", logical, block); in INFTL_dumpVUchains()
514 if (s->PUtable[block] == BLOCK_NIL) in INFTL_dumpVUchains()
516 block = s->PUtable[block]; in INFTL_dumpVUchains()
517 pr_debug("%d ", block); in INFTL_dumpVUchains()
529 unsigned int block, first_block, prev_block, last_block; in INFTL_mount() local
550 logical_block = block = BLOCK_NIL; in INFTL_mount()
572 block = first_block; in INFTL_mount()
577 (s->PUtable[block] != BLOCK_NOTEXPLORED)) { in INFTL_mount()
582 if (inftl_read_oob(mtd, block * s->EraseSize + 8, in INFTL_mount()
584 inftl_read_oob(mtd, block * s->EraseSize + in INFTL_mount()
595 ANACtable[block] = h0.ANAC; in INFTL_mount()
602 if (s->PUtable[block] != BLOCK_NOTEXPLORED) { in INFTL_mount()
606 s->PUtable[last_block] = block; in INFTL_mount()
615 "mark 0x%x?\n", block, first_block, in INFTL_mount()
629 s->PUtable[block] = BLOCK_FREE; in INFTL_mount()
640 block, first_block); in INFTL_mount()
661 s->PUtable[block] = BLOCK_NIL; in INFTL_mount()
663 s->PUtable[last_block] = block; in INFTL_mount()
664 last_block = block; in INFTL_mount()
665 block = prev_block; in INFTL_mount()
668 if (block == BLOCK_NIL) in INFTL_mount()
672 if (block > s->lastEUN) { in INFTL_mount()
674 "block %d in chain %d?\n", block, in INFTL_mount()
705 block = s->VUtable[logical_block]; in INFTL_mount()
709 if (block >= BLOCK_RESERVED) in INFTL_mount()
712 ANAC = ANACtable[block]; in INFTL_mount()
714 if (s->PUtable[block] == BLOCK_NIL) in INFTL_mount()
716 if (s->PUtable[block] > s->lastEUN) { in INFTL_mount()
719 s->PUtable[block], logical_block); in INFTL_mount()
720 s->PUtable[block] = BLOCK_NIL; in INFTL_mount()
723 if (ANACtable[block] != ANAC) { in INFTL_mount()
729 s->VUtable[logical_block] = block; in INFTL_mount()
735 last_block = block; in INFTL_mount()
736 block = s->PUtable[block]; in INFTL_mount()
758 for (block = s->firstEUN; block <= s->lastEUN; block++) { in INFTL_mount()
759 if (s->PUtable[block] == BLOCK_NOTEXPLORED) { in INFTL_mount()
761 block); in INFTL_mount()
762 if (INFTL_formatblock(s, block) < 0) in INFTL_mount()
763 s->PUtable[block] = BLOCK_RESERVED; in INFTL_mount()
765 s->PUtable[block] = BLOCK_FREE; in INFTL_mount()
767 if (s->PUtable[block] == BLOCK_FREE) { in INFTL_mount()
770 s->LastFreeEUN = block; in INFTL_mount()