Lines Matching defs:bs
434 struct block_space *bs;
454 bs = get_bs(chip->swap, block, 1);
455 if (!bs)
459 memset(&bs->blk_ptr[offset], error->pattern, error->len);
465 nandsim_set_block_state(struct sim_block_state *bs)
472 bs->chip_num, bs->ctrl_num, bs->block_num);
474 if (bs->ctrl_num >= MAX_SIM_DEV ||
475 bs->chip_num >= MAX_CTRL_CS)
478 chip = get_nandsim_chip(bs->ctrl_num, bs->chip_num);
482 if (bs->block_num > blocks)
485 chip->blk_state[bs->block_num].is_bad = bs->state;
487 if (bs->wearout >= 0)
488 chip->blk_state[bs->block_num].wear_lev = bs->wearout;
494 nandsim_get_block_state(struct sim_block_state *bs)
500 if (bs->ctrl_num >= MAX_SIM_DEV ||
501 bs->chip_num >= MAX_CTRL_CS)
505 bs->chip_num, bs->ctrl_num, bs->block_num);
507 chip = get_nandsim_chip(bs->ctrl_num, bs->chip_num);
511 if (bs->block_num > blocks)
514 bs->state = chip->blk_state[bs->block_num].is_bad;
515 bs->wearout = chip->blk_state[bs->block_num].wear_lev;
524 struct block_space *bs;
537 bs = get_bs(chip->swap, dump->block_num, 0);
538 if (!bs)
544 copyout(bs->blk_ptr, dump->data, dump->len);
553 struct block_space *bs;
567 bs = get_bs(chip->swap, dump->block_num, 1);
568 if (!bs)
575 copyin(dump->data, bs->blk_ptr, dump->len);