#include <obd_class.h>
#include <obd_cksum.h>
+#if IS_ENABLED(CONFIG_CRC_T10DIF)
__u16 obd_dif_crc_fn(void *data, unsigned int len)
{
return cpu_to_be16(crc_t10dif(data, len));
memset(buf, 0xAD, PAGE_SIZE);
kunmap(page);
- for (start = jiffies, end = start + msecs_to_jiffies(MSEC_PER_SEC / 4),
+ for (start = jiffies, end = start + cfs_time_seconds(1) / 4,
bcount = 0; time_before(jiffies, end) && rc == 0; bcount++) {
rc = __obd_t10_performance_test(obd_name, cksum_type, page,
buf_len / PAGE_SIZE);
obd_t10_cksum_speeds[index]);
}
}
+#endif /* CONFIG_CRC_T10DIF */
int obd_t10_cksum_speed(const char *obd_name,
enum cksum_types cksum_type)
{
+#if IS_ENABLED(CONFIG_CRC_T10DIF)
enum obd_t10_cksum_type index = obd_t10_cksum2type(cksum_type);
if (unlikely(obd_t10_cksum_speeds[index] == 0)) {
}
return obd_t10_cksum_speeds[index];
+#else /* !CONFIG_CRC_T10DIF */
+ return 0;
+#endif /* !CONFIG_CRC_T10DIF */
}
EXPORT_SYMBOL(obd_t10_cksum_speed);