Lines Matching full: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()
70 printk(KERN_WARNING "INFTL: block read at 0x%x " in find_boot_record()
72 block * inftl->EraseSize, in find_boot_record()
76 "failures for this block will " 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()
202 * to erase the hidden block for full in find_boot_record()
252 * Block count is set to last used EUN (we won't need to keep in find_boot_record()
286 /* Mark this boot record (NFTL MediaHeader) block as reserved */ in find_boot_record()
287 inftl->PUtable[block] = BLOCK_RESERVED; in find_boot_record()
301 inftl->MediaUnit = block; in find_boot_record()
368 int INFTL_formatblock(struct INFTLrecord *inftl, int block) in INFTL_formatblock() argument
376 pr_debug("INFTL: INFTL_formatblock(inftl=%p,block=%d)\n", inftl, block); in INFTL_formatblock()
384 instr->addr = block * inftl->EraseSize; in INFTL_formatblock()
388 mark only the failed block in the bbt. */ in INFTL_formatblock()
395 printk(KERN_WARNING "INFTL: error while formatting block %d\n", in INFTL_formatblock()
396 block); in INFTL_formatblock()
415 instr->addr = block * inftl->EraseSize + SECTORSIZE * 2; in INFTL_formatblock()
420 /* could not format, update the bad block table (caller is responsible in INFTL_formatblock()
436 unsigned int block = first_block, block1; in format_chain() local
438 printk(KERN_WARNING "INFTL: formatting chain at block %d\n", in format_chain()
442 block1 = inftl->PUtable[block]; in format_chain()
444 printk(KERN_WARNING "INFTL: formatting block %d\n", block); in format_chain()
445 if (INFTL_formatblock(inftl, block) < 0) { in format_chain()
449 inftl->PUtable[block] = BLOCK_RESERVED; in format_chain()
451 inftl->PUtable[block] = BLOCK_FREE; in format_chain()
454 /* Goto next block on the chain */ in format_chain()
455 block = block1; in format_chain()
457 if (block == BLOCK_NIL || block >= inftl->lastEUN) in format_chain()
509 int logical, block, i; in INFTL_dumpVUchains() local
516 block = s->VUtable[logical]; in INFTL_dumpVUchains()
517 if (block >= s->nb_blocks) in INFTL_dumpVUchains()
519 pr_debug(" LOGICAL %d --> %d ", logical, block); in INFTL_dumpVUchains()
521 if (s->PUtable[block] == BLOCK_NIL) in INFTL_dumpVUchains()
523 block = s->PUtable[block]; in INFTL_dumpVUchains()
524 pr_debug("%d ", block); in INFTL_dumpVUchains()
536 unsigned int block, first_block, prev_block, last_block; in INFTL_mount() local
557 logical_block = block = BLOCK_NIL; in INFTL_mount()
571 * Any block that is in any way invalid will be left in the in INFTL_mount()
583 block = first_block; in INFTL_mount()
588 (s->PUtable[block] != BLOCK_NOTEXPLORED)) { in INFTL_mount()
589 /* Nothing to do here, onto next block */ in INFTL_mount()
593 if (inftl_read_oob(mtd, block * s->EraseSize + 8, in INFTL_mount()
595 inftl_read_oob(mtd, block * s->EraseSize + in INFTL_mount()
606 ANACtable[block] = h0.ANAC; in INFTL_mount()
608 /* Previous block is relative to start of Partition */ in INFTL_mount()
613 if (s->PUtable[block] != BLOCK_NOTEXPLORED) { in INFTL_mount()
617 s->PUtable[last_block] = block; in INFTL_mount()
622 /* Check for invalid block */ in INFTL_mount()
624 printk(KERN_WARNING "INFTL: corrupt block %d " in INFTL_mount()
626 "mark 0x%x?\n", block, first_block, in INFTL_mount()
640 s->PUtable[block] = BLOCK_FREE; in INFTL_mount()
644 /* Sanity checks on block numbers */ in INFTL_mount()
650 "block %d in chain %d?\n", in INFTL_mount()
651 block, first_block); in INFTL_mount()
667 * Current block is valid, so if we followed a virtual in INFTL_mount()
669 * block pointer in our PUtable now. Then move onto in INFTL_mount()
670 * the previous block in the chain. in INFTL_mount()
672 s->PUtable[block] = BLOCK_NIL; in INFTL_mount()
674 s->PUtable[last_block] = block; in INFTL_mount()
675 last_block = block; in INFTL_mount()
676 block = prev_block; in INFTL_mount()
679 if (block == BLOCK_NIL) in INFTL_mount()
682 /* Validate next block before following it... */ in INFTL_mount()
683 if (block > s->lastEUN) { in INFTL_mount()
685 "block %d in chain %d?\n", block, in INFTL_mount()
699 * newest block in the chain, but it is the newest we have in INFTL_mount()
716 block = s->VUtable[logical_block]; in INFTL_mount()
720 if (block >= BLOCK_RESERVED) in INFTL_mount()
723 ANAC = ANACtable[block]; in INFTL_mount()
725 if (s->PUtable[block] == BLOCK_NIL) in INFTL_mount()
727 if (s->PUtable[block] > s->lastEUN) { in INFTL_mount()
730 s->PUtable[block], logical_block); in INFTL_mount()
731 s->PUtable[block] = BLOCK_NIL; in INFTL_mount()
734 if (ANACtable[block] != ANAC) { in INFTL_mount()
738 * newest block and oldest block. in INFTL_mount()
740 s->VUtable[logical_block] = block; in INFTL_mount()
746 last_block = block; in INFTL_mount()
747 block = s->PUtable[block]; in INFTL_mount()
763 * Third pass, format unreferenced blocks and init free block count. in INFTL_mount()
769 for (block = s->firstEUN; block <= s->lastEUN; block++) { in INFTL_mount()
770 if (s->PUtable[block] == BLOCK_NOTEXPLORED) { in INFTL_mount()
771 printk("INFTL: unreferenced block %d, formatting it\n", in INFTL_mount()
772 block); in INFTL_mount()
773 if (INFTL_formatblock(s, block) < 0) in INFTL_mount()
774 s->PUtable[block] = BLOCK_RESERVED; in INFTL_mount()
776 s->PUtable[block] = BLOCK_FREE; in INFTL_mount()
778 if (s->PUtable[block] == BLOCK_FREE) { in INFTL_mount()
781 s->LastFreeEUN = block; in INFTL_mount()