The byte swap functions which are defined in ext2fs.h are only needed
by crc32.c, and not by gen_crc32ctable.c. The gen_crc32ctable program
needs to be compiled on the host OS, where ext2fs.h may not be
present. So move the use of the header function to crc32c.c, to avoid
compilation problems.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The functions htole32(), le32toh(), be32toh(), htobe32() aren't
defined in all environments. Use the ext2fs byte swap functions for
portability.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Add a slicing-by-8 CRC32c implementation for metadata checksumming.
Adapted from Bob Pearson's kernel patch.
Also added a self-test mechanism so we can verify that the crc32c
implementation is working correctly.
Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>