Lines Matching full:bbt

32  * nanddev_read_bbt() - Read the BBT (Bad Block Table)
34 * @block: bbt block address
35 * @update: true - get version and overwrite bbt.cache with new version;
36 * false - get bbt version only;
38 * Initialize the in-memory BBT.
47 BITS_PER_LONG) * sizeof(*nand->bbt.cache); in nanddev_read_bbt()
57 if (!nand->bbt.cache) in nanddev_read_bbt()
114 if (update && version > nand->bbt.version) { in nanddev_read_bbt()
115 memcpy(nand->bbt.cache, data_buf, nbytes); in nanddev_read_bbt()
116 nand->bbt.version = version; in nanddev_read_bbt()
131 BITS_PER_LONG) * sizeof(*nand->bbt.cache); in nanddev_write_bbt()
140 BBT_DBG("write_bbt to blk=%d ver=%d\n", block, nand->bbt.version); in nanddev_write_bbt()
141 if (!nand->bbt.cache) in nanddev_write_bbt()
164 memcpy(data_buf, nand->bbt.cache, nbytes); in nanddev_write_bbt()
166 bbt_info->version = nand->bbt.version; in nanddev_write_bbt()
239 nand->bbt.version = 0; in nanddev_scan_bbt()
244 nand->bbt.option |= NANDDEV_BBT_SCANNED; in nanddev_scan_bbt()
245 if (nand->bbt.version == 0) { in nanddev_scan_bbt()
249 nand->bbt.option = 0; in nanddev_scan_bbt()
260 * nanddev_bbt_init() - Initialize the BBT (Bad Block Table)
263 * Initialize the in-memory BBT.
274 nand->bbt.cache = kcalloc(nwords, sizeof(*nand->bbt.cache), in snanddev_bbt_init()
276 if (!nand->bbt.cache) in snanddev_bbt_init()
284 * nanddev_bbt_cleanup() - Cleanup the BBT (Bad Block Table)
291 kfree(nand->bbt.cache); in snanddev_bbt_cleanup()
296 * nanddev_bbt_update() - Update a BBT
299 * Update the BBT. Currently a NOP function since on-flash bbt is not yet
307 if (nand->bbt.cache && in snanddev_bbt_update()
308 nand->bbt.option & NANDDEV_BBT_USE_FLASH) { in snanddev_bbt_update()
342 nand->bbt.version++; in snanddev_bbt_update()
369 * @entry: the BBT entry
372 * is bigger than the BBT size.
378 unsigned long *pos = nand->bbt.cache + in snanddev_bbt_get_block_status()
384 if (nand->bbt.option & NANDDEV_BBT_USE_FLASH && in snanddev_bbt_get_block_status()
385 !(nand->bbt.option & NANDDEV_BBT_SCANNED)) in snanddev_bbt_get_block_status()
402 * in-memory BBT
404 * @entry: the BBT entry to update
407 * Update an entry of the in-memory BBT. If you want to push the updated BBT
410 * Return: 0 in case of success or -%ERANGE if @entry is bigger than the BBT
418 unsigned long *pos = nand->bbt.cache + in snanddev_bbt_set_block_status()