Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/ext2fs/ext2_csum.c
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | crc = ext2_crc16(~0, fs->e2fs->e2fs_uuid, | ||||
sizeof(fs->e2fs->e2fs_uuid)); | sizeof(fs->e2fs->e2fs_uuid)); | ||||
crc = ext2_crc16(crc, (uint8_t *)&block_group, | crc = ext2_crc16(crc, (uint8_t *)&block_group, | ||||
sizeof(block_group)); | sizeof(block_group)); | ||||
crc = ext2_crc16(crc, (uint8_t *)gd, offset); | crc = ext2_crc16(crc, (uint8_t *)gd, offset); | ||||
offset += sizeof(gd->ext4bgd_csum); /* skip checksum */ | offset += sizeof(gd->ext4bgd_csum); /* skip checksum */ | ||||
if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_64BIT) && | if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_64BIT) && | ||||
offset < fs->e2fs->e3fs_desc_size) | offset < fs->e2fs->e3fs_desc_size) | ||||
crc = ext2_crc16(crc, (uint8_t *)gd + offset, | crc = ext2_crc16(crc, (uint8_t *)gd + offset, | ||||
fs->e2fs->e3fs_desc_size - offset); | fs->e2fs->e3fs_desc_size - offset); | ||||
return (crc); | return (crc); | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
ext2_gd_csum_verify(struct m_ext2fs *fs, struct cdev *dev) | ext2_gd_csum_verify(struct m_ext2fs *fs, struct cdev *dev) | ||||
Show All 28 Lines |