Lines Matching refs:block0

456 static int doc_read_seek(struct docg3 *docg3, int block0, int block1, int page,  in doc_read_seek()  argument
462 block0, block1, page, ofs, wear); in doc_read_seek()
481 sector = (block0 << DOC_ADDR_BLOCK_SHIFT) + (page & DOC_ADDR_PAGE_MASK); in doc_read_seek()
505 static int doc_write_seek(struct docg3 *docg3, int block0, int block1, int page, in doc_write_seek() argument
511 block0, block1, page, ofs); in doc_write_seek()
528 sector = (block0 << DOC_ADDR_BLOCK_SHIFT) + (page & DOC_ADDR_PAGE_MASK); in doc_write_seek()
695 static int doc_read_page_prepare(struct docg3 *docg3, int block0, int block1, in doc_read_page_prepare() argument
701 block0, block1, page, offset); in doc_read_page_prepare()
713 ret = doc_read_seek(docg3, block0, block1, page, wear_area, offset); in doc_read_page_prepare()
832 static void calc_block_sector(loff_t from, int *block0, int *block1, int *page, in calc_block_sector() argument
842 *block0 = sector / pages_biblock * DOC_LAYOUT_NBPLANES; in calc_block_sector()
843 *block1 = *block0 + 1; in calc_block_sector()
869 int block0, block1, page, ret, skip, ofs = 0; in doc_read_oob() local
899 calc_block_sector(from - skip, &block0, &block1, &page, &ofs, in doc_read_oob()
903 ret = doc_read_page_prepare(docg3, block0, block1, page, ofs); in doc_read_oob()
940 if ((block0 >= DOC_LAYOUT_BLOCK_FIRST_DATA) && in doc_read_oob()
1008 int block0, block1, page, ofs, is_good; in doc_block_isbad() local
1010 calc_block_sector(from, &block0, &block1, &page, &ofs, in doc_block_isbad()
1013 from, block0, block1, page, ofs); in doc_block_isbad()
1015 if (block0 < DOC_LAYOUT_BLOCK_FIRST_DATA) in doc_block_isbad()
1020 is_good = docg3->bbt[block0 >> 3] & (1 << (block0 & 0x7)); in doc_block_isbad()
1039 int block0, block1, page, ofs;
1044 calc_block_sector(from, &block0, &block1, &page, &ofs, docg3->reliable);
1050 ret = doc_read_page_prepare(docg3, block0, block1, page,
1134 static int doc_erase_block(struct docg3 *docg3, int block0, int block1) in doc_erase_block() argument
1138 doc_dbg("doc_erase_block(blocks=(%d,%d))\n", block0, block1); in doc_erase_block()
1146 sector = block0 << DOC_ADDR_BLOCK_SHIFT; in doc_erase_block()
1158 doc_err("Erase blocks %d,%d error\n", block0, block1); in doc_erase_block()
1180 int block0, block1, page, ret = 0, ofs = 0; in doc_erase() local
1184 calc_block_sector(info->addr + info->len, &block0, &block1, &page, in doc_erase()
1189 calc_block_sector(info->addr, &block0, &block1, &page, &ofs, in doc_erase()
1195 ret = doc_erase_block(docg3, block0, block1); in doc_erase()
1196 block0 += 2; in doc_erase()
1226 int block0, block1, page, ret, ofs = 0; in doc_write_page() local
1230 calc_block_sector(to, &block0, &block1, &page, &ofs, docg3->reliable); in doc_write_page()
1238 ret = doc_write_seek(docg3, block0, block1, page, ofs); in doc_write_page()