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,
69 position = (index + rsb) * v->fec->roots;
70 block = div64_u64_rem(position, v->fec->io_size, &rem);
73 res = dm_bufio_read_with_ioprio(v->fec->bufio, block, buf, ioprio);
109 return &fio->bufs[i][j * v->fec->rsn];
141 * one corrected target byte and consumes fec->roots parity bytes.
159 offset += v->fec->roots;
160 if (offset >= v->fec->io_size) {
227 for (i = 0; i < v->fec->rsn; i++) {
228 ileaved = fec_interleave(v, rsb * v->fec->rsn + i);
238 bufio = v->fec->data_bufio;
247 if (unlikely(block >= v->fec->hash_blocks))
262 if (neras && *neras <= v->fec->roots)
269 if (bufio == v->fec->data_bufio &&
278 * maximum number (i.e. fec->roots) of erasures
280 if (neras && *neras <= v->fec->roots &&
314 fio->rs = mempool_alloc(&v->fec->rs_pool, GFP_NOIO);
320 fio->bufs[n] = mempool_alloc(&v->fec->prealloc_pool, GFP_NOWAIT);
332 fio->bufs[n] = mempool_alloc(&v->fec->extra_pool, GFP_NOWAIT);
340 fio->output = mempool_alloc(&v->fec->output_pool, GFP_NOIO);
354 memset(fio->bufs[n], 0, v->fec->rsn << DM_VERITY_FEC_BUF_RS_BITS);
454 res = div64_u64(offset, v->fec->rounds << v->data_dev_block_bits);
460 rsb = offset - res * (v->fec->rounds << v->data_dev_block_bits);
492 struct dm_verity_fec *f = io->v->fec;
539 v->fec->dev->name,
540 (unsigned long long)v->fec->blocks,
541 (unsigned long long)v->fec->start,
542 v->fec->roots);
549 struct dm_verity_fec *f = v->fec;
569 v->fec = NULL;
576 return init_rs_gfp(8, 0x11d, 0, 1, v->fec->roots, gfp_mask);
614 r = dm_get_device(ti, arg_value, BLK_OPEN_READ, &v->fec->dev);
627 v->fec->blocks = num_ll;
636 v->fec->start = num_ll;
645 v->fec->roots = num_c;
656 * Allocate dm_verity_fec for v->fec. Must be called before verity_fec_ctr.
667 v->fec = f;
678 struct dm_verity_fec *f = v->fec;
752 f->io_size = v->fec->roots << SECTOR_SHIFT;
764 fec_blocks = div64_u64(f->rounds * f->roots, v->fec->roots << SECTOR_SHIFT);