Lines Matching refs:boffset

198 static loff_t sm_mkoffset(struct sm_ftl *ftl, int zone, int block, int boffset)  in sm_mkoffset()  argument
200 WARN_ON(boffset & (SM_SECTOR_SIZE - 1)); in sm_mkoffset()
203 WARN_ON(boffset >= ftl->block_size); in sm_mkoffset()
208 return (zone * SM_MAX_ZONE_SIZE + block) * ftl->block_size + boffset; in sm_mkoffset()
213 int *zone, int *block, int *boffset) in sm_break_offset() argument
215 *boffset = do_div(offset, ftl->block_size); in sm_break_offset()
240 int zone, int block, int boffset, in sm_read_sector() argument
270 if (zone == 0 && block == ftl->cis_block && boffset == in sm_read_sector()
281 ret = mtd->read_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops); in sm_read_sector()
322 int zone, int block, int boffset, in sm_write_sector() argument
346 ret = mtd->write_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops); in sm_write_sector()
374 int boffset; in sm_write_block() local
384 for (boffset = 0; boffset < ftl->block_size; in sm_write_block()
385 boffset += SM_SECTOR_SIZE) { in sm_write_block()
389 if (test_bit(boffset / SM_SECTOR_SIZE, &invalid_bitmap)) { in sm_write_block()
393 boffset / SM_SECTOR_SIZE, lba, zone); in sm_write_block()
399 __nand_calculate_ecc(buf + boffset, in sm_write_block()
402 __nand_calculate_ecc(buf + boffset + SM_SMALL_PAGE, in sm_write_block()
405 if (!sm_write_sector(ftl, zone, block, boffset, in sm_write_block()
406 buf + boffset, &oob)) in sm_write_block()
435 int boffset; in sm_mark_block_bad() local
451 for (boffset = 0; boffset < ftl->block_size; boffset += SM_SECTOR_SIZE) in sm_mark_block_bad()
452 sm_write_sector(ftl, zone, block, boffset, NULL, &oob); in sm_mark_block_bad()
516 int boffset; in sm_check_block() local
526 for (boffset = 0; boffset < ftl->block_size; in sm_check_block()
527 boffset += SM_SECTOR_SIZE) { in sm_check_block()
530 if (sm_read_sector(ftl, zone, block, boffset, NULL, &oob)) in sm_check_block()
693 int block, boffset; in sm_find_cis() local
713 for (boffset = 0 ; boffset < ftl->block_size; in sm_find_cis()
714 boffset += SM_SECTOR_SIZE) { in sm_find_cis()
716 if (sm_read_sector(ftl, 0, block, boffset, NULL, &oob)) in sm_find_cis()
724 if (boffset == ftl->block_size) in sm_find_cis()
728 ftl->cis_boffset = boffset; in sm_find_cis()
741 boffset + ftl->cis_page_offset); in sm_find_cis()
913 void sm_cache_put(struct sm_ftl *ftl, char *buffer, int boffset) in sm_cache_put() argument
915 memcpy(ftl->cache_data + boffset, buffer, SM_SECTOR_SIZE); in sm_cache_put()
916 clear_bit(boffset / SM_SECTOR_SIZE, &ftl->cache_data_invalid_bitmap); in sm_cache_put()
921 int sm_cache_get(struct sm_ftl *ftl, char *buffer, int boffset) in sm_cache_get() argument
923 if (test_bit(boffset / SM_SECTOR_SIZE, in sm_cache_get()
927 memcpy(buffer, ftl->cache_data + boffset, SM_SECTOR_SIZE); in sm_cache_get()
1020 int zone_num, block, boffset; in sm_read() local
1022 sm_break_offset(ftl, sect_no << 9, &zone_num, &block, &boffset); in sm_read()
1035 if (!sm_cache_get(ftl, buf, boffset)) in sm_read()
1047 if (sm_read_sector(ftl, zone_num, block, boffset, buf, NULL)) { in sm_read()
1053 sm_cache_put(ftl, buf, boffset); in sm_read()
1065 int error, zone_num, block, boffset; in sm_write() local
1068 sm_break_offset(ftl, sec_no << 9, &zone_num, &block, &boffset); in sm_write()
1091 sm_cache_put(ftl, buf, boffset); in sm_write()