Lines Matching refs:fec

8 #include "dm-verity-fec.h"
11 #define DM_MSG_PREFIX "verity-fec"
18 return v->fec && v->fec->dev;
38 mod = do_div(offset, v->fec->rsn);
39 return offset + mod * (v->fec->rounds << v->data_dev_block_bits);
46 u8 *data, u8 *fec, int neras)
51 for (i = 0; i < v->fec->roots; i++)
52 par[i] = fec[i];
54 return decode_rs8(fio->rs, data, par, v->fec->rsn, NULL, neras,
68 position = (index + rsb) * v->fec->roots;
69 block = div64_u64_rem(position, v->fec->io_size, &rem);
72 res = dm_bufio_read(v->fec->bufio, block, buf);
108 return &fio->bufs[i][j * v->fec->rsn];
139 * one corrected target byte and consumes fec->roots parity bytes.
157 offset += v->fec->roots;
158 if (offset >= v->fec->io_size) {
224 for (i = 0; i < v->fec->rsn; i++) {
225 ileaved = fec_interleave(v, rsb * v->fec->rsn + i);
235 bufio = v->fec->data_bufio;
244 if (unlikely(block >= v->fec->hash_blocks))
259 if (neras && *neras <= v->fec->roots)
266 if (bufio == v->fec->data_bufio &&
275 * maximum number (i.e. fec->roots) of erasures
277 if (neras && *neras <= v->fec->roots &&
311 fio->rs = mempool_alloc(&v->fec->rs_pool, GFP_NOIO);
317 fio->bufs[n] = mempool_alloc(&v->fec->prealloc_pool, GFP_NOWAIT);
329 fio->bufs[n] = mempool_alloc(&v->fec->extra_pool, GFP_NOWAIT);
337 fio->output = mempool_alloc(&v->fec->output_pool, GFP_NOIO);
351 memset(fio->bufs[n], 0, v->fec->rsn << DM_VERITY_FEC_BUF_RS_BITS);
451 res = div64_u64(offset, v->fec->rounds << v->data_dev_block_bits);
457 rsb = offset - res * (v->fec->rounds << v->data_dev_block_bits);
489 struct dm_verity_fec *f = io->v->fec;
536 v->fec->dev->name,
537 (unsigned long long)v->fec->blocks,
538 (unsigned long long)v->fec->start,
539 v->fec->roots);
546 struct dm_verity_fec *f = v->fec;
566 v->fec = NULL;
573 return init_rs_gfp(8, 0x11d, 0, 1, v->fec->roots, gfp_mask);
611 r = dm_get_device(ti, arg_value, FMODE_READ, &v->fec->dev);
624 v->fec->blocks = num_ll;
633 v->fec->start = num_ll;
642 v->fec->roots = num_c;
653 * Allocate dm_verity_fec for v->fec. Must be called before verity_fec_ctr.
664 v->fec = f;
675 struct dm_verity_fec *f = v->fec;
749 f->io_size = v->fec->roots << SECTOR_SHIFT;
761 fec_blocks = div64_u64(f->rounds * f->roots, v->fec->roots << SECTOR_SHIFT);