Lines Matching refs:block

278 	int block;  in NFTL_foldchain()  local
305 for (block = 0; block < nftl->EraseSize / 512; block ++) { in NFTL_foldchain()
307 (thisEUN * nftl->EraseSize) + (block * 512), in NFTL_foldchain()
309 if (block == 2) { in NFTL_foldchain()
323 BlockLastState[block] = status; in NFTL_foldchain()
327 BlockFreeFound[block] = 1; in NFTL_foldchain()
331 if (!BlockFreeFound[block]) in NFTL_foldchain()
332 BlockMap[block] = thisEUN; in NFTL_foldchain()
337 thisVUC, block); in NFTL_foldchain()
340 if (!BlockFreeFound[block]) in NFTL_foldchain()
341 BlockMap[block] = BLOCK_NIL; in NFTL_foldchain()
346 thisVUC, block); in NFTL_foldchain()
353 block, thisEUN, status); in NFTL_foldchain()
374 for (block = 0; block < nftl->EraseSize / 512 ; block++) { in NFTL_foldchain()
375 if (BlockLastState[block] != SECTOR_FREE && in NFTL_foldchain()
376 BlockMap[block] != BLOCK_NIL && in NFTL_foldchain()
377 BlockMap[block] != targetEUN) { in NFTL_foldchain()
381 thisVUC, block, BlockLastState[block], in NFTL_foldchain()
382 BlockMap[block], in NFTL_foldchain()
383 BlockMap[block]== targetEUN ? "==" : "!=", in NFTL_foldchain()
432 for (block = 0; block < nftl->EraseSize / 512 ; block++) { in NFTL_foldchain()
437 if (BlockMap[block] == targetEUN || in NFTL_foldchain()
438 (pendingblock == (thisVUC * (nftl->EraseSize / 512) + block))) { in NFTL_foldchain()
444 if (BlockMap[block] == BLOCK_NIL) in NFTL_foldchain()
447 ret = MTD_READECC(nftl->mtd, (nftl->EraseSize * BlockMap[block]) + (block * 512), in NFTL_foldchain()
450 ret = MTD_READECC(nftl->mtd, (nftl->EraseSize * BlockMap[block]) in NFTL_foldchain()
451 + (block * 512), 512, &retlen, in NFTL_foldchain()
456 MTD_WRITEECC(nftl->mtd, (nftl->EraseSize * targetEUN) + (block * 512), in NFTL_foldchain()
557 static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block) in NFTL_findwriteunit() argument
560 u16 thisVUC = block / (nftl->EraseSize / 512); in NFTL_findwriteunit()
562 unsigned long blockofs = (block * 512) & (nftl->EraseSize -1); in NFTL_findwriteunit()
589 block , writeEUN, le16_to_cpu(bci.Status)); in NFTL_findwriteunit()
707 static int NFTL_writeblock(struct NFTLrecord *nftl, unsigned block, char *buffer) in NFTL_writeblock() argument
710 unsigned long blockofs = (block * 512) & (nftl->EraseSize - 1); in NFTL_writeblock()
714 writeEUN = NFTL_findwriteunit(nftl, block); in NFTL_writeblock()
731 static int NFTL_readblock(struct NFTLrecord *nftl, unsigned block, char *buffer) in NFTL_readblock() argument
734 u16 thisEUN = nftl->EUNtable[block / (nftl->EraseSize / 512)]; in NFTL_readblock()
735 unsigned long blockofs = (block * 512) & (nftl->EraseSize - 1); in NFTL_readblock()
765 block, thisEUN, status); in NFTL_readblock()
771 block / (nftl->EraseSize / 512)); in NFTL_readblock()
871 unsigned int dev, block, nsect; in nftl_request() local
891 block = req->sector; in nftl_request()
909 if (block + nsect > part_table[dev].nr_sects) { in nftl_request()
912 (MINOR(req->rq_dev)>>6)+'a', dev & 0xf, block, nsect); in nftl_request()
918 block += part_table[dev].start_sect; in nftl_request()
922 "(req->nr_sectors == %lx)\n", nsect, block, req->nr_sectors); in nftl_request()
924 for ( ; nsect > 0; nsect-- , block++, buffer += 512) { in nftl_request()
926 if (NFTL_readblock(nftl, block, buffer)) { in nftl_request()
939 "(req->nr_sectors == %lx)\n", nsect, block, in nftl_request()
942 for ( ; nsect > 0; nsect-- , block++, buffer += 512) { in nftl_request()
944 if (NFTL_writeblock(nftl, block, buffer)) { in nftl_request()