Lines Matching refs:s

466 void INFTL_dumptables(struct INFTLrecord *s)  in INFTL_dumptables()  argument
473 pr_debug("VUtable[%d] ->", s->nb_blocks); in INFTL_dumptables()
474 for (i = 0; i < s->nb_blocks; i++) { in INFTL_dumptables()
477 pr_debug("%04x ", s->VUtable[i]); in INFTL_dumptables()
483 pr_debug("PUtable[%d-%d=%d] ->", s->firstEUN, s->lastEUN, s->nb_blocks); in INFTL_dumptables()
484 for (i = 0; i <= s->lastEUN; i++) { in INFTL_dumptables()
487 pr_debug("%04x ", s->PUtable[i]); in INFTL_dumptables()
503 s->EraseSize, s->heads, s->sectors, s->cylinders, in INFTL_dumptables()
504 s->numvunits, s->firstEUN, s->lastEUN, s->numfreeEUNs, in INFTL_dumptables()
505 s->LastFreeEUN, s->nb_blocks, s->nb_boot_blocks); in INFTL_dumptables()
511 void INFTL_dumpVUchains(struct INFTLrecord *s) in INFTL_dumpVUchains() argument
519 for (logical = 0; logical < s->nb_blocks; logical++) { in INFTL_dumpVUchains()
520 block = s->VUtable[logical]; in INFTL_dumpVUchains()
521 if (block >= s->nb_blocks) in INFTL_dumpVUchains()
524 for (i = 0; i < s->nb_blocks; i++) { in INFTL_dumpVUchains()
525 if (s->PUtable[block] == BLOCK_NIL) in INFTL_dumpVUchains()
527 block = s->PUtable[block]; in INFTL_dumpVUchains()
537 int INFTL_mount(struct INFTLrecord *s) in INFTL_mount() argument
539 struct mtd_info *mtd = s->mbd.mtd; in INFTL_mount()
549 pr_debug("INFTL: INFTL_mount(inftl=%p)\n", s); in INFTL_mount()
552 if (find_boot_record(s) < 0) { in INFTL_mount()
558 for (i = 0; i < s->nb_blocks; i++) in INFTL_mount()
559 s->VUtable[i] = BLOCK_NIL; in INFTL_mount()
564 ANACtable = kcalloc(s->nb_blocks, sizeof(u8), GFP_KERNEL); in INFTL_mount()
568 s->nb_blocks * sizeof(u8)); in INFTL_mount()
580 for (first_block = s->firstEUN; first_block <= s->lastEUN; first_block++) { in INFTL_mount()
581 if (s->PUtable[first_block] != BLOCK_NOTEXPLORED) in INFTL_mount()
592 (s->PUtable[block] != BLOCK_NOTEXPLORED)) { in INFTL_mount()
597 if (inftl_read_oob(mtd, block * s->EraseSize + 8, in INFTL_mount()
599 inftl_read_oob(mtd, block * s->EraseSize + in INFTL_mount()
613 if (prev_block < s->nb_blocks) in INFTL_mount()
614 prev_block += s->firstEUN; in INFTL_mount()
617 if (s->PUtable[block] != BLOCK_NOTEXPLORED) { in INFTL_mount()
621 s->PUtable[last_block] = block; in INFTL_mount()
644 s->PUtable[block] = BLOCK_FREE; in INFTL_mount()
649 if ((logical_block >= s->nb_blocks) || in INFTL_mount()
650 ((prev_block >= s->nb_blocks) && in INFTL_mount()
676 s->PUtable[block] = BLOCK_NIL; in INFTL_mount()
678 s->PUtable[last_block] = block; in INFTL_mount()
687 if (block > s->lastEUN) { in INFTL_mount()
697 format_chain(s, first_block); in INFTL_mount()
707 s->VUtable[first_logical_block] = first_block; in INFTL_mount()
711 INFTL_dumptables(s); in INFTL_mount()
719 for (logical_block = 0; logical_block < s->numvunits; logical_block++) { in INFTL_mount()
720 block = s->VUtable[logical_block]; in INFTL_mount()
728 for (i = 0; i < s->numvunits; i++) { in INFTL_mount()
729 if (s->PUtable[block] == BLOCK_NIL) in INFTL_mount()
731 if (s->PUtable[block] > s->lastEUN) { in INFTL_mount()
734 s->PUtable[block], logical_block); in INFTL_mount()
735 s->PUtable[block] = BLOCK_NIL; in INFTL_mount()
744 s->VUtable[logical_block] = block; in INFTL_mount()
745 s->PUtable[last_block] = BLOCK_NIL; in INFTL_mount()
751 block = s->PUtable[block]; in INFTL_mount()
754 if (i >= s->nb_blocks) { in INFTL_mount()
759 format_chain(s, first_block); in INFTL_mount()
763 INFTL_dumptables(s); in INFTL_mount()
764 INFTL_dumpVUchains(s); in INFTL_mount()
769 s->numfreeEUNs = 0; in INFTL_mount()
770 s->LastFreeEUN = BLOCK_NIL; in INFTL_mount()
773 for (block = s->firstEUN; block <= s->lastEUN; block++) { in INFTL_mount()
774 if (s->PUtable[block] == BLOCK_NOTEXPLORED) { in INFTL_mount()
777 if (INFTL_formatblock(s, block) < 0) in INFTL_mount()
778 s->PUtable[block] = BLOCK_RESERVED; in INFTL_mount()
780 s->PUtable[block] = BLOCK_FREE; in INFTL_mount()
782 if (s->PUtable[block] == BLOCK_FREE) { in INFTL_mount()
783 s->numfreeEUNs++; in INFTL_mount()
784 if (s->LastFreeEUN == BLOCK_NIL) in INFTL_mount()
785 s->LastFreeEUN = block; in INFTL_mount()