int lafs_calc_cluster_csum(struct cluster_head *head)
{
unsigned int oldcsum = head->checksum;
- unsigned long long newcsum = 0;
unsigned long csum;
- int i;
- unsigned int *superc = (unsigned int *) head;
- head->checksum = 0;
- for (i = 0; i < __le16_to_cpu(head->Hlength)/4; i++)
- newcsum += __le32_to_cpu(superc[i]);
- csum = (newcsum & 0xffffffff) + (newcsum>>32);
+ head->checksum = 0;
+ csum = crc32(0, (uint32_t *)head, __le16_to_cpu(head->Hlength));
head->checksum = oldcsum;
return __cpu_to_le32(csum);
}