Lines Matching defs:boffset
182 static loff_t sm_mkoffset(struct sm_ftl *ftl, int zone, int block, int boffset)
184 WARN_ON(boffset & (SM_SECTOR_SIZE - 1));
187 WARN_ON(boffset >= ftl->block_size);
192 return (zone * SM_MAX_ZONE_SIZE + block) * ftl->block_size + boffset;
197 int *zone, int *block, int *boffset)
199 *boffset = do_div(offset, ftl->block_size);
224 int zone, int block, int boffset,
254 if (zone == 0 && block == ftl->cis_block && boffset ==
265 ret = mtd->read_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops);
306 int zone, int block, int boffset,
330 ret = mtd->write_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops);
358 int boffset;
368 for (boffset = 0; boffset < ftl->block_size;
369 boffset += SM_SECTOR_SIZE) {
373 if (test_bit(boffset / SM_SECTOR_SIZE, &invalid_bitmap)) {
377 boffset / SM_SECTOR_SIZE, lba, zone);
383 __nand_calculate_ecc(buf + boffset,
386 __nand_calculate_ecc(buf + boffset + SM_SMALL_PAGE,
389 if (!sm_write_sector(ftl, zone, block, boffset,
390 buf + boffset, &oob))
419 int boffset;
435 for (boffset = 0; boffset < ftl->block_size; boffset += SM_SECTOR_SIZE)
436 sm_write_sector(ftl, zone, block, boffset, NULL, &oob);
500 int boffset;
510 for (boffset = 0; boffset < ftl->block_size;
511 boffset += SM_SECTOR_SIZE) {
514 if (sm_read_sector(ftl, zone, block, boffset, NULL, &oob))
677 int block, boffset;
697 for (boffset = 0 ; boffset < ftl->block_size;
698 boffset += SM_SECTOR_SIZE) {
700 if (sm_read_sector(ftl, 0, block, boffset, NULL, &oob))
708 if (boffset == ftl->block_size)
712 ftl->cis_boffset = boffset;
725 boffset + ftl->cis_page_offset);
897 void sm_cache_put(struct sm_ftl *ftl, char *buffer, int boffset)
899 memcpy(ftl->cache_data + boffset, buffer, SM_SECTOR_SIZE);
900 clear_bit(boffset / SM_SECTOR_SIZE, &ftl->cache_data_invalid_bitmap);
905 int sm_cache_get(struct sm_ftl *ftl, char *buffer, int boffset)
907 if (test_bit(boffset / SM_SECTOR_SIZE,
911 memcpy(buffer, ftl->cache_data + boffset, SM_SECTOR_SIZE);
1004 int zone_num, block, boffset;
1006 sm_break_offset(ftl, sect_no << 9, &zone_num, &block, &boffset);
1019 if (!sm_cache_get(ftl, buf, boffset))
1031 if (sm_read_sector(ftl, zone_num, block, boffset, buf, NULL)) {
1037 sm_cache_put(ftl, buf, boffset);
1049 int error, zone_num, block, boffset;
1052 sm_break_offset(ftl, sec_no << 9, &zone_num, &block, &boffset);
1075 sm_cache_put(ftl, buf, boffset);