Lines Matching refs:buffer
8 * Calculate the intermediate checksum for a buffer that has the CRC field
10 * cksum_offset parameter. We do not modify the buffer during verification,
14 xfs_start_cksum_safe(char *buffer, size_t length, unsigned long cksum_offset)
20 crc = crc32c(XFS_CRC_SEED, buffer, cksum_offset);
26 return crc32c(crc, &buffer[cksum_offset + sizeof(__be32)],
31 * Fast CRC method where the buffer is modified. Callers must have exclusive
32 * access to the buffer while the calculation takes place.
35 xfs_start_cksum_update(char *buffer, size_t length, unsigned long cksum_offset)
38 *(__le32 *)(buffer + cksum_offset) = 0;
40 /* single pass CRC calculation for the entire buffer */
41 return crc32c(XFS_CRC_SEED, buffer, length);
58 * Helper to generate the checksum for a buffer.
60 * This modifies the buffer temporarily - callers must have exclusive
61 * access to the buffer while the calculation takes place.
64 xfs_update_cksum(char *buffer, size_t length, unsigned long cksum_offset)
66 uint32_t crc = xfs_start_cksum_update(buffer, length, cksum_offset);
68 *(__le32 *)(buffer + cksum_offset) = xfs_end_cksum(crc);
72 * Helper to verify the checksum for a buffer.
75 xfs_verify_cksum(char *buffer, size_t length, unsigned long cksum_offset)
77 uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset);
79 return *(__le32 *)(buffer + cksum_offset) == xfs_end_cksum(crc);