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);
238 int zone, int block, int boffset,
270 if (zone == 0 && block == ftl->cis_block && boffset ==
282 ret = mtd_read_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops);
323 int zone, int block, int boffset,
347 ret = mtd_write_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops);
375 int boffset;
385 for (boffset = 0; boffset < ftl->block_size;
386 boffset += SM_SECTOR_SIZE) {
390 if (test_bit(boffset / SM_SECTOR_SIZE, &invalid_bitmap)) {
394 boffset / SM_SECTOR_SIZE, lba, zone);
400 ecc_sw_hamming_calculate(buf + boffset,
404 ecc_sw_hamming_calculate(buf + boffset + SM_SMALL_PAGE,
408 if (!sm_write_sector(ftl, zone, block, boffset,
409 buf + boffset, &oob))
439 int boffset;
456 for (boffset = 0; boffset < ftl->block_size; boffset += SM_SECTOR_SIZE)
457 sm_write_sector(ftl, zone, block, boffset, NULL, &oob);
503 int boffset;
514 for (boffset = 0; boffset < ftl->block_size;
515 boffset += SM_SECTOR_SIZE) {
518 if (sm_read_sector(ftl, zone, block, boffset, NULL, &oob))
683 int block, boffset;
703 for (boffset = 0 ; boffset < ftl->block_size;
704 boffset += SM_SECTOR_SIZE) {
706 if (sm_read_sector(ftl, 0, block, boffset, NULL, &oob))
714 if (boffset == ftl->block_size)
718 ftl->cis_boffset = boffset;
731 boffset + ftl->cis_page_offset);
911 static void sm_cache_put(struct sm_ftl *ftl, char *buffer, int boffset)
913 memcpy(ftl->cache_data + boffset, buffer, SM_SECTOR_SIZE);
914 clear_bit(boffset / SM_SECTOR_SIZE, &ftl->cache_data_invalid_bitmap);
919 static int sm_cache_get(struct sm_ftl *ftl, char *buffer, int boffset)
921 if (test_bit(boffset / SM_SECTOR_SIZE,
925 memcpy(buffer, ftl->cache_data + boffset, SM_SECTOR_SIZE);
1019 int zone_num, block, boffset;
1021 sm_break_offset(ftl, sect_no << 9, &zone_num, &block, &boffset);
1034 if (!sm_cache_get(ftl, buf, boffset))
1046 if (sm_read_sector(ftl, zone_num, block, boffset, buf, NULL)) {
1052 sm_cache_put(ftl, buf, boffset);
1064 int error = 0, zone_num, block, boffset;
1067 sm_break_offset(ftl, sec_no << 9, &zone_num, &block, &boffset);
1090 sm_cache_put(ftl, buf, boffset);