/* Calculate the checksum of a disk block and store it at the indicated position.  */
void affs_fix_checksum(struct super_block *sb, struct buffer_head *bh)
/* Calculate the checksum of a disk block and store it at the indicated position.  */
void affs_fix_checksum(struct super_block *sb, struct buffer_head *bh)
{
	int cnt = sb->s_blocksize / sizeof(__be32);
	__be32 *ptr = (__be32 *)bh->b_data;
	u32 checksum;
	__be32 *checksumptr;
	checksumptr = ptr + 5;
	*checksumptr = 0;
	for (checksum = 0; cnt > 0; ptr++, cnt--)
		checksum += be32_to_cpu(*ptr);
	*checksumptr = cpu_to_be32(-checksum);
}