* checksum type due to its benchmarking at libcfs module load.
* Caution is advised, however, since what is fastest on a single client may
* not be the fastest or most efficient algorithm on the server. */
-static inline enum cksum_types
-obd_cksum_type_select(const char *obd_name, enum cksum_types cksum_types)
+static inline
+enum cksum_types obd_cksum_type_select(const char *obd_name,
+ enum cksum_types cksum_types,
+ enum cksum_types preferred)
{
- u32 flag = obd_cksum_type_pack(obd_name, cksum_types);
+ u32 flag;
+
+ if (preferred & cksum_types)
+ return preferred;
+
+ flag = obd_cksum_type_pack(obd_name, cksum_types);
return obd_cksum_type_unpack(flag);
}
*fn = NULL;
*sector_size = 0;
+#if IS_ENABLED(CONFIG_CRC_T10DIF)
switch (cksum_type) {
case OBD_CKSUM_T10IP512:
*fn = obd_dif_ip_fn;
default:
break;
}
+#endif /* CONFIG_CRC_T10DIF */
}
enum obd_t10_cksum_type {