Lines Matching refs:fec
18 return v->fec && v->fec->dev; in verity_fec_is_enabled()
38 mod = do_div(offset, v->fec->rsn); in fec_interleave()
39 return offset + mod * (v->fec->rounds << v->data_dev_block_bits); in fec_interleave()
57 position = (index + rsb) * v->fec->roots; in fec_read_parity()
58 block = div64_u64_rem(position, v->fec->io_size, &rem); in fec_read_parity()
61 res = dm_bufio_read_with_ioprio(v->fec->bufio, block, buf, ioprio); in fec_read_parity()
97 return &fio->bufs[i][j * v->fec->rsn]; in fec_buffer_rs_block()
135 for (j = 0; j < v->fec->roots - par_buf_offset; j++) in fec_decode_bufs()
138 res = decode_rs8(fio->rs, block, par_buf, v->fec->rsn, in fec_decode_bufs()
153 offset += (v->fec->roots - par_buf_offset); in fec_decode_bufs()
155 if (offset < v->fec->io_size && (offset + v->fec->roots) > v->fec->io_size) { in fec_decode_bufs()
156 par_buf_offset = v->fec->io_size - offset; in fec_decode_bufs()
163 if (offset >= v->fec->io_size) { in fec_decode_bufs()
230 for (i = 0; i < v->fec->rsn; i++) { in fec_read_bufs()
231 ileaved = fec_interleave(v, rsb * v->fec->rsn + i); in fec_read_bufs()
241 bufio = v->fec->data_bufio; in fec_read_bufs()
250 if (unlikely(block >= v->fec->hash_blocks)) in fec_read_bufs()
265 if (neras && *neras <= v->fec->roots) in fec_read_bufs()
272 if (bufio == v->fec->data_bufio && in fec_read_bufs()
283 if (neras && *neras <= v->fec->roots && in fec_read_bufs()
317 fio->rs = mempool_alloc(&v->fec->rs_pool, GFP_NOIO); in fec_alloc_bufs()
323 fio->bufs[n] = mempool_alloc(&v->fec->prealloc_pool, GFP_NOWAIT); in fec_alloc_bufs()
335 fio->bufs[n] = mempool_alloc(&v->fec->extra_pool, GFP_NOWAIT); in fec_alloc_bufs()
343 fio->output = mempool_alloc(&v->fec->output_pool, GFP_NOIO); in fec_alloc_bufs()
357 memset(fio->bufs[n], 0, v->fec->rsn << DM_VERITY_FEC_BUF_RS_BITS); in fec_init_bufs()
441 res = div64_u64(offset, v->fec->rounds << v->data_dev_block_bits); in verity_fec_decode()
447 rsb = offset - res * (v->fec->rounds << v->data_dev_block_bits); in verity_fec_decode()
474 struct dm_verity_fec *f = io->v->fec; in verity_fec_finish_io()
521 v->fec->dev->name, in verity_fec_status_table()
522 (unsigned long long)v->fec->blocks, in verity_fec_status_table()
523 (unsigned long long)v->fec->start, in verity_fec_status_table()
524 v->fec->roots); in verity_fec_status_table()
531 struct dm_verity_fec *f = v->fec; in verity_fec_dtr()
551 v->fec = NULL; in verity_fec_dtr()
558 return init_rs_gfp(8, 0x11d, 0, 1, v->fec->roots, gfp_mask); in fec_rs_alloc()
596 if (v->fec->dev) { in verity_fec_parse_opt_args()
600 r = dm_get_device(ti, arg_value, BLK_OPEN_READ, &v->fec->dev); in verity_fec_parse_opt_args()
613 v->fec->blocks = num_ll; in verity_fec_parse_opt_args()
622 v->fec->start = num_ll; in verity_fec_parse_opt_args()
631 v->fec->roots = num_c; in verity_fec_parse_opt_args()
653 v->fec = f; in verity_fec_ctr_alloc()
664 struct dm_verity_fec *f = v->fec; in verity_fec_ctr()
747 fec_blocks = div64_u64(f->rounds * f->roots, v->fec->roots << SECTOR_SHIFT); in verity_fec_ctr()