Lines Matching refs:boffset
192 static loff_t sm_mkoffset(struct sm_ftl *ftl, int zone, int block, int boffset)
194 WARN_ON(boffset & (SM_SECTOR_SIZE - 1));
197 WARN_ON(boffset >= ftl->block_size);
202 return (zone * SM_MAX_ZONE_SIZE + block) * ftl->block_size + boffset;
207 int *zone, int *block, int *boffset)
210 *boffset = do_div(offset, ftl->block_size);
239 int zone, int block, int boffset,
270 if (zone == 0 && block == ftl->cis_block && boffset ==
281 ret = mtd_read_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops);
322 int zone, int block, int boffset,
346 ret = mtd_write_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops);
373 int boffset;
383 for (boffset = 0; boffset < ftl->block_size;
384 boffset += SM_SECTOR_SIZE) {
388 if (test_bit(boffset / SM_SECTOR_SIZE, &invalid_bitmap)) {
392 boffset / SM_SECTOR_SIZE, lba, zone);
398 __nand_calculate_ecc(buf + boffset, SM_SMALL_PAGE,
402 __nand_calculate_ecc(buf + boffset + SM_SMALL_PAGE,
406 if (!sm_write_sector(ftl, zone, block, boffset,
407 buf + boffset, &oob))
436 int boffset;
452 for (boffset = 0; boffset < ftl->block_size; boffset += SM_SECTOR_SIZE)
453 sm_write_sector(ftl, zone, block, boffset, NULL, &oob);
499 int boffset;
509 for (boffset = 0; boffset < ftl->block_size;
510 boffset += SM_SECTOR_SIZE) {
513 if (sm_read_sector(ftl, zone, block, boffset, NULL, &oob))
676 int block, boffset;
696 for (boffset = 0 ; boffset < ftl->block_size;
697 boffset += SM_SECTOR_SIZE) {
699 if (sm_read_sector(ftl, 0, block, boffset, NULL, &oob))
707 if (boffset == ftl->block_size)
711 ftl->cis_boffset = boffset;
724 boffset + ftl->cis_page_offset);
899 static void sm_cache_put(struct sm_ftl *ftl, char *buffer, int boffset)
901 memcpy(ftl->cache_data + boffset, buffer, SM_SECTOR_SIZE);
902 clear_bit(boffset / SM_SECTOR_SIZE, &ftl->cache_data_invalid_bitmap);
907 static int sm_cache_get(struct sm_ftl *ftl, char *buffer, int boffset)
909 if (test_bit(boffset / SM_SECTOR_SIZE,
913 memcpy(buffer, ftl->cache_data + boffset, SM_SECTOR_SIZE);
1006 int zone_num, block, boffset;
1008 sm_break_offset(ftl, sect_no << 9, &zone_num, &block, &boffset);
1021 if (!sm_cache_get(ftl, buf, boffset))
1033 if (sm_read_sector(ftl, zone_num, block, boffset, buf, NULL)) {
1039 sm_cache_put(ftl, buf, boffset);
1051 int error = 0, zone_num, block, boffset;
1054 sm_break_offset(ftl, sec_no << 9, &zone_num, &block, &boffset);
1077 sm_cache_put(ftl, buf, boffset);