Lines Matching full:crc
8 * Calculate the intermediate checksum for a buffer that has the CRC field
9 * inside it. The offset of the 32bit crc fields is passed as the
11 * hence we have to split the CRC calculation across the cksum_offset.
17 uint32_t crc; in xfs_start_cksum_safe() local
19 /* Calculate CRC up to the checksum. */ in xfs_start_cksum_safe()
20 crc = crc32c(XFS_CRC_SEED, buffer, cksum_offset); in xfs_start_cksum_safe()
23 crc = crc32c(crc, &zero, sizeof(__u32)); in xfs_start_cksum_safe()
25 /* Calculate the rest of the CRC. */ in xfs_start_cksum_safe()
26 return crc32c(crc, &buffer[cksum_offset + sizeof(__be32)], in xfs_start_cksum_safe()
31 * Fast CRC method where the buffer is modified. Callers must have exclusive
37 /* zero the CRC field */ in xfs_start_cksum_update()
40 /* single pass CRC calculation for the entire buffer */ in xfs_start_cksum_update()
52 xfs_end_cksum(uint32_t crc) in xfs_end_cksum() argument
54 return ~cpu_to_le32(crc); in xfs_end_cksum()
66 uint32_t crc = xfs_start_cksum_update(buffer, length, cksum_offset); in xfs_update_cksum() local
68 *(__le32 *)(buffer + cksum_offset) = xfs_end_cksum(crc); in xfs_update_cksum()
77 uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset); in xfs_verify_cksum() local
79 return *(__le32 *)(buffer + cksum_offset) == xfs_end_cksum(crc); in xfs_verify_cksum()