#include "acconfig.h"
#include "common/crc32c_intel_baseline.h"
-extern unsigned int crc32_iscsi_00(unsigned char const *buffer, uint64_t len, uint64_t crc) asm("crc32_iscsi_00");
extern unsigned int crc32_iscsi_01(unsigned char const *buffer, uint64_t len, uint64_t crc) asm("crc32_iscsi_01");
extern unsigned int crc32_iscsi_zero_00(unsigned char const *buffer, uint64_t len, uint64_t crc) asm("crc32_iscsi_zero_00");
return crc32_iscsi_zero_00(buffer, len, crc);
}
- /* Unlike crc32_iscsi_00, crc32_iscsi_01 handles the case where the
- * input buffer is less than 8 bytes in its prelude, and does not
- * prefetch beyond said buffer.
- */
return crc32_iscsi_01(buffer, len, crc);
}
return crc32_iscsi_zero_00(buffer, len, crc);
}
- /*
- * the crc32_iscsi_00 method reads past buffer+len (because it
- * reads full words) which makes valgrind unhappy. don't do
- * that.
- */
- if (len < 16)
- return ceph_crc32c_intel_baseline(crc, buffer, len);
left = ((unsigned long)buffer + len) & 7;
len -= left;
- v = crc32_iscsi_00(buffer, len, crc);
+ v = crc32_iscsi_01(buffer, len, crc);
if (left)
v = ceph_crc32c_intel_baseline(v, buffer + len, left);
return v;