Lines Matching refs:fec

18 	return v->fec && v->fec->dev;  in verity_fec_is_enabled()
37 mod = do_div(offset, v->fec->rsn); in fec_interleave()
38 return offset + mod * (v->fec->rounds << v->data_dev_block_bits); in fec_interleave()
45 u8 *data, u8 *fec, int neras) in fec_decode_rs8() argument
50 for (i = 0; i < v->fec->roots; i++) in fec_decode_rs8()
51 par[i] = fec[i]; in fec_decode_rs8()
53 return decode_rs8(fio->rs, data, par, v->fec->rsn, NULL, neras, in fec_decode_rs8()
67 position = (index + rsb) * v->fec->roots; in fec_read_parity()
68 block = div64_u64_rem(position, v->fec->io_size, &rem); in fec_read_parity()
71 res = dm_bufio_read(v->fec->bufio, block, buf); in fec_read_parity()
107 return &fio->bufs[i][j * v->fec->rsn]; in fec_buffer_rs_block()
156 offset += v->fec->roots; in fec_decode_bufs()
157 if (offset >= v->fec->io_size) { in fec_decode_bufs()
223 for (i = 0; i < v->fec->rsn; i++) { in fec_read_bufs()
224 ileaved = fec_interleave(v, rsb * v->fec->rsn + i); in fec_read_bufs()
234 bufio = v->fec->data_bufio; in fec_read_bufs()
243 if (unlikely(block >= v->fec->hash_blocks)) in fec_read_bufs()
258 if (neras && *neras <= v->fec->roots) in fec_read_bufs()
265 if (bufio == v->fec->data_bufio && in fec_read_bufs()
276 if (neras && *neras <= v->fec->roots && in fec_read_bufs()
310 fio->rs = mempool_alloc(&v->fec->rs_pool, GFP_NOIO); in fec_alloc_bufs()
316 fio->bufs[n] = mempool_alloc(&v->fec->prealloc_pool, GFP_NOWAIT); in fec_alloc_bufs()
328 fio->bufs[n] = mempool_alloc(&v->fec->extra_pool, GFP_NOWAIT); in fec_alloc_bufs()
336 fio->output = mempool_alloc(&v->fec->output_pool, GFP_NOIO); in fec_alloc_bufs()
350 memset(fio->bufs[n], 0, v->fec->rsn << DM_VERITY_FEC_BUF_RS_BITS); in fec_init_bufs()
450 res = div64_u64(offset, v->fec->rounds << v->data_dev_block_bits); in verity_fec_decode()
456 rsb = offset - res * (v->fec->rounds << v->data_dev_block_bits); in verity_fec_decode()
488 struct dm_verity_fec *f = io->v->fec; in verity_fec_finish_io()
535 v->fec->dev->name, in verity_fec_status_table()
536 (unsigned long long)v->fec->blocks, in verity_fec_status_table()
537 (unsigned long long)v->fec->start, in verity_fec_status_table()
538 v->fec->roots); in verity_fec_status_table()
545 struct dm_verity_fec *f = v->fec; in verity_fec_dtr()
565 v->fec = NULL; in verity_fec_dtr()
572 return init_rs_gfp(8, 0x11d, 0, 1, v->fec->roots, gfp_mask); in fec_rs_alloc()
610 r = dm_get_device(ti, arg_value, FMODE_READ, &v->fec->dev); in verity_fec_parse_opt_args()
623 v->fec->blocks = num_ll; in verity_fec_parse_opt_args()
632 v->fec->start = num_ll; in verity_fec_parse_opt_args()
641 v->fec->roots = num_c; in verity_fec_parse_opt_args()
663 v->fec = f; in verity_fec_ctr_alloc()
674 struct dm_verity_fec *f = v->fec; in verity_fec_ctr()
748 f->io_size = v->fec->roots << SECTOR_SHIFT; in verity_fec_ctr()
760 fec_blocks = div64_u64(f->rounds * f->roots, v->fec->roots << SECTOR_SHIFT); in verity_fec_ctr()