Lines Matching full:crc

283 	lp.crc = bch2_extent_crc_unpack(l.k, NULL);  in bch2_extent_merge()
284 rp.crc = bch2_extent_crc_unpack(r.k, NULL); in bch2_extent_merge()
288 if (lp.ptr.offset + lp.crc.offset + lp.crc.live_size != in bch2_extent_merge()
289 rp.ptr.offset + rp.crc.offset || in bch2_extent_merge()
312 if (lp.crc.compression_type != rp.crc.compression_type || in bch2_extent_merge()
313 lp.crc.nonce != rp.crc.nonce) in bch2_extent_merge()
316 if (lp.crc.offset + lp.crc.live_size + rp.crc.live_size <= in bch2_extent_merge()
317 lp.crc.uncompressed_size) { in bch2_extent_merge()
318 /* can use left extent's crc entry */ in bch2_extent_merge()
319 } else if (lp.crc.live_size <= rp.crc.offset) { in bch2_extent_merge()
320 /* can use right extent's crc entry */ in bch2_extent_merge()
323 if (lp.crc.csum_type != rp.crc.csum_type || in bch2_extent_merge()
324 lp.crc.nonce != rp.crc.nonce || in bch2_extent_merge()
325 crc_is_compressed(lp.crc) || in bch2_extent_merge()
326 !bch2_checksum_mergeable(lp.crc.csum_type)) in bch2_extent_merge()
329 if (lp.crc.offset + lp.crc.live_size != lp.crc.compressed_size || in bch2_extent_merge()
330 rp.crc.offset) in bch2_extent_merge()
333 if (lp.crc.csum_type && in bch2_extent_merge()
334 lp.crc.uncompressed_size + in bch2_extent_merge()
335 rp.crc.uncompressed_size > (c->opts.encoded_extent_max >> 9)) in bch2_extent_merge()
377 /* can use left extent's crc entry */ in bch2_extent_merge()
379 /* can use right extent's crc entry */ in bch2_extent_merge()
473 struct bch_extent_crc_unpacked crc; in bch2_can_narrow_extent_crcs() local
479 bkey_for_each_crc(k.k, ptrs, crc, i) in bch2_can_narrow_extent_crcs()
480 if (can_narrow_crc(crc, n)) in bch2_can_narrow_extent_crcs()
523 if (can_narrow_crc(p.crc, n)) { in bch2_bkey_narrow_crcs()
525 p.ptr.offset += p.crc.offset; in bch2_bkey_narrow_crcs()
526 p.crc = n; in bch2_bkey_narrow_crcs()
573 union bch_extent_crc *crc = (void *) ptrs.end; in bch2_extent_crc_append() local
591 bch2_extent_crc_pack(crc, new, type); in bch2_extent_crc_append()
624 ret += !p.ptr.cached && !crc_is_compressed(p.crc); in bch2_bkey_nr_ptrs_fully_allocated()
638 if (!p.ptr.cached && crc_is_compressed(p.crc)) in bch2_bkey_sectors_compressed()
639 ret += p.crc.compressed_size; in bch2_bkey_sectors_compressed()
648 struct bch_extent_crc_unpacked crc; in bch2_bkey_is_incompressible() local
650 bkey_for_each_crc(k.k, ptrs, crc, entry) in bch2_bkey_is_incompressible()
651 if (crc.compression_type == BCH_COMPRESSION_TYPE_incompressible) in bch2_bkey_is_incompressible()
748 struct bch_extent_crc_unpacked crc = in bch2_extent_ptr_decoded_append() local
752 if (!bch2_crc_unpacked_cmp(crc, p->crc)) { in bch2_extent_ptr_decoded_append()
757 bkey_for_each_crc(&k->k, ptrs, crc, pos) in bch2_extent_ptr_decoded_append()
758 if (!bch2_crc_unpacked_cmp(crc, p->crc)) { in bch2_extent_ptr_decoded_append()
763 bch2_extent_crc_append(k, p->crc); in bch2_extent_ptr_decoded_append()
914 (s64) p.ptr.offset + p.crc.offset - bkey_start_offset(k.k) == in bch2_bkey_matches_ptr()
949 (s64) p1.ptr.offset + p1.crc.offset - bkey_start_offset(k1.k) == in bch2_extents_match()
950 (s64) p2.ptr.offset + p2.crc.offset - bkey_start_offset(k2.k) && in bch2_extents_match()
962 p1.ptr.offset < p2.ptr.offset + p2.crc.compressed_size) || in bch2_extents_match()
964 p2.ptr.offset < p1.ptr.offset + p1.crc.compressed_size))) in bch2_extents_match()
984 (s64) p1.ptr.offset + p1.crc.offset - bkey_start_offset(k1.k) == in bch2_extent_has_ptr()
985 (s64) p2.ptr.offset + p2.crc.offset - bkey_start_offset(k2.k)) in bch2_extent_has_ptr()
1121 void bch2_extent_crc_unpacked_to_text(struct printbuf *out, struct bch_extent_crc_unpacked *crc) in bch2_extent_crc_unpacked_to_text() argument
1123 prt_printf(out, "crc: c_size %u size %u offset %u nonce %u csum ", in bch2_extent_crc_unpacked_to_text()
1124 crc->compressed_size, in bch2_extent_crc_unpacked_to_text()
1125 crc->uncompressed_size, in bch2_extent_crc_unpacked_to_text()
1126 crc->offset, crc->nonce); in bch2_extent_crc_unpacked_to_text()
1127 bch2_prt_csum_type(out, crc->csum_type); in bch2_extent_crc_unpacked_to_text()
1128 prt_printf(out, " %0llx:%0llx ", crc->csum.hi, crc->csum.lo); in bch2_extent_crc_unpacked_to_text()
1130 bch2_prt_compression_type(out, crc->compression_type); in bch2_extent_crc_unpacked_to_text()
1206 struct bch_extent_crc_unpacked crc = in bch2_bkey_ptrs_to_text() local
1209 bch2_extent_crc_unpacked_to_text(out, &crc); in bch2_bkey_ptrs_to_text()
1280 struct bch_extent_crc_unpacked crc; in bch2_bkey_ptrs_validate() local
1323 crc = bch2_extent_crc_unpack(k.k, entry_to_crc(entry)); in bch2_bkey_ptrs_validate()
1325 bkey_fsck_err_on(!bch2_checksum_type_valid(c, crc.csum_type), in bch2_bkey_ptrs_validate()
1328 bkey_fsck_err_on(crc.compression_type >= BCH_COMPRESSION_TYPE_NR, in bch2_bkey_ptrs_validate()
1332 bkey_fsck_err_on(crc.offset + crc.live_size > crc.uncompressed_size, in bch2_bkey_ptrs_validate()
1335 bkey_fsck_err_on(crc_is_encoded(crc) && in bch2_bkey_ptrs_validate()
1336 (crc.uncompressed_size > c->opts.encoded_extent_max >> 9) && in bch2_bkey_ptrs_validate()
1340 bkey_fsck_err_on(!crc_is_compressed(crc) && in bch2_bkey_ptrs_validate()
1341 crc.compressed_size != crc.uncompressed_size, in bch2_bkey_ptrs_validate()
1345 if (bch2_csum_type_is_encryption(crc.csum_type)) { in bch2_bkey_ptrs_validate()
1347 nonce = crc.offset + crc.nonce; in bch2_bkey_ptrs_validate()
1348 else if (nonce != crc.offset + crc.nonce) in bch2_bkey_ptrs_validate()
1355 "redundant crc entry"); in bch2_bkey_ptrs_validate()
1358 size_ondisk = crc.compressed_size; in bch2_bkey_ptrs_validate()
1401 "redundant crc entry"); in bch2_bkey_ptrs_validate()