Lines Matching refs:ecc
102 check(f->ecc.rsn > 0 && f->ecc.rsn < FEC_RSM); in parse_ecc_header()
138 if (f->ecc.roots != (int)header.roots) { in parse_ecc_header()
139 error("unexpected number of roots: %d vs %u", f->ecc.roots, in parse_ecc_header()
150 f->ecc.blocks = fec_div_round_up(f->data_size, FEC_BLOCKSIZE); in parse_ecc_header()
151 f->ecc.rounds = fec_div_round_up(f->ecc.blocks, f->ecc.rsn); in parse_ecc_header()
154 (uint32_t)f->ecc.rounds * f->ecc.roots * FEC_BLOCKSIZE) { in parse_ecc_header()
159 f->ecc.size = header.fec_size; in parse_ecc_header()
160 f->ecc.start = header.inp_size; in parse_ecc_header()
170 while (n < f->ecc.size) { in parse_ecc_header()
171 if (len > f->ecc.size - n) { in parse_ecc_header()
172 len = f->ecc.size - n; in parse_ecc_header()
175 if (!raw_pread(f->fd, buf, len, f->ecc.start + n)) { in parse_ecc_header()
187 f->ecc.valid = !memcmp(hash, header.hash, SHA256_DIGEST_LENGTH); in parse_ecc_header()
189 if (!f->ecc.valid) { in parse_ecc_header()
355 f->ecc.start); in load_ecc()
404 f->ecc = {}; in reset_handle()
464 if (!f->ecc.start) { in fec_ecc_get_metadata()
469 check(f->ecc.start >= f->data_size); in fec_ecc_get_metadata()
470 check(f->ecc.start < f->size); in fec_ecc_get_metadata()
471 check(f->ecc.start % FEC_BLOCKSIZE == 0) in fec_ecc_get_metadata()
473 data->valid = f->ecc.valid; in fec_ecc_get_metadata()
474 data->roots = f->ecc.roots; in fec_ecc_get_metadata()
475 data->blocks = f->ecc.blocks; in fec_ecc_get_metadata()
476 data->rounds = f->ecc.rounds; in fec_ecc_get_metadata()
477 data->start = f->ecc.start; in fec_ecc_get_metadata()
527 f->ecc.roots = roots; in fec_open()
528 f->ecc.rsn = FEC_RSM - roots; in fec_open()